home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / kcx25asc.lha / KCX / Printer.Asm < prev    next >
Encoding:
Assembly Source File  |  1993-06-21  |  77.6 KB  |  3,253 lines

  1.         NOLIST
  2. * This can only be assembled under DEVPAC V3.01 since there are many opcodes
  3. * only DEVPAC 3.01 understands. As far as I know.
  4.  
  5. DEBUG        SET     0
  6.  
  7.         OPT    ow-,o+,ow6+,NODEBUG,NOLINE,ALINK
  8.  
  9. *AUTO:        smake KCX
  10.  
  11.  
  12. ;* $Revision Header built automatically *************** (do not edit) ************
  13. ;*
  14. ;* © Copyright by GuntherSoft
  15. ;*
  16. ;* File             : SnakeSYS:ASMPrgs/KCX/Printer.Asm
  17. ;* Created on       : Tuesday, 10-Nov-92 18:18:58
  18. ;* Created by       : Kai Iske
  19. ;* Current revision : V2.5
  20. ;*
  21. ;*
  22. ;* Purpose
  23. ;* -------
  24. ;*     Printer program, which will be loaded on demand.
  25. ;*
  26. ;* Revision V2.5
  27. ;* --------------
  28. ;*     --- Initial release ---
  29. ;*
  30. ;*********************************************************************************
  31.  
  32.  
  33.  
  34.  
  35.         INCLUDE    KCXBase.i
  36.         INCLUDE    KCX_Lib.i
  37.         INCLUDE    KCX.i
  38.  
  39.         INCLUDE    Misc/MyMacros.i
  40.  
  41.         IFGT    DEBUG
  42.         INCLUDE    Misc/Debug.i
  43.         ENDC
  44.  
  45.  
  46.  
  47. **********************************************************************
  48. *         Local parameters for font-sensitive window open up         *
  49. **********************************************************************
  50.         CARGS    #-(4+4+2+2+2+2),OffY.W,OffX.W,FontY.W,FontX.W,FontPtr.L
  51.  
  52.         SECTION    MyCode,CODE
  53.         bra.s    PrinterProc
  54. Version        dc.b    "$VER: KCXPrinter "
  55.         REVISION
  56.         dc.b    " ("
  57.         REVDATE
  58.         dc.b    ")",0
  59.         EVEN
  60.  
  61. **********************************************************************
  62. *                    This is the Printer process                     *
  63. **********************************************************************
  64. PrinterProc    movem.l    RegsAll,-(sp)
  65.  
  66.         sub.l    a4,a4
  67.         sub.l    a1,a1
  68.         CALLSYS    FindTask
  69.         move.l    d0,a5
  70.         tst.l    pr_CLI(a5)
  71.         bne.s    .FromCLI
  72.         lea    pr_MsgPort(a5),a0
  73.         DOLIB    WaitPort
  74.         lea    pr_MsgPort(a5),a0
  75.         DOLIB    GetMsg
  76.         move.l    d0,MyWBMsg
  77.  
  78. .FromCLI    cmp.w    #NEED_LIBVER,LIB_VERSION(a6)
  79.         bge.s    .IsOver20
  80.  
  81.         tst.l    MyWBMsg
  82.         bne.s    .FromWB
  83.         lea    DosName,a1
  84.         moveq    #0,d0
  85.         DOLIB    OpenLibrary
  86.         move.l    d0,a6
  87.         DOLIB    Output
  88.         move.l    d0,d1
  89.         move.l    #Only20Txt,d2
  90.         move.l    #Only20TxtEnd-Only20Txt,d3
  91.         DOLIB    Write
  92.         move.l    a6,a1
  93.         CALLSYS    CloseLibrary
  94.         bra    .EndPrg
  95. .FromWB        lea    IntName,a1            ; try to open IntBase
  96.         moveq    #0,d0
  97.         CALLSYS    OpenLibrary
  98.         tst.l    d0
  99.         beq    .Error
  100.         move.l    d0,a6
  101.         sub.l    a0,a0                ; Display requester
  102.         lea    Only20ITxt(pc),a1
  103.         lea    OkITxt(pc),a2
  104.         move.l    a2,a3
  105.         moveq    #0,d0
  106.         moveq    #0,d1
  107.         move.l    #300,d2
  108.         move.l    #60,d3
  109.         DOLIB    AutoRequest
  110.         move.l    a6,a1
  111.         CALLSYS    CloseLibrary
  112.         bra    .EndPrg
  113.  
  114. .IsOver20    lea    BackPortName(pc),a1        ; Try to find KCX`s port
  115.         CALLSYS    FindPort
  116.         tst.l    d0
  117.         bne.s    .GotBack
  118.         lea    IntName(pc),a1
  119.         moveq    #NEED_LIBVER,d0
  120.         DOLIB    OpenLibrary
  121.         tst.l    d0
  122.         beq    .Error
  123.         move.l    d0,a6
  124.         sub.l    a0,a0
  125.         lea    NoBackRequest(pc),a1
  126.         LOCLEA    PrintHead,a2
  127.         move.l    a2,es_Title(a1)
  128.         LOCLEA    NoBackText,a2
  129.         move.l    a2,es_TextFormat(a1)
  130.         sub.l    a2,a2
  131.         lea    VersionTag,a3
  132.         DOLIB    EasyRequestArgs
  133.         move.l    a6,a1
  134.         CALLSYS    CloseLibrary
  135.         bra    .EndPrg
  136.  
  137. .GotBack    move.l    d0,a0                ; Get address of datablock
  138.         move.l    MP_SIZE(a0),a4
  139.         move.l    a4,ZeroBase
  140.  
  141.         tst.l    PrintProc(a4)
  142.         bne.s    .Error
  143.  
  144.         lea    StrEditHook,a0            ; Initialize the StringEdit-Hook
  145.         move.l    #MyStrEditFunc,h_Entry(a0)
  146.         clr.l    h_SubEntry(a0)
  147.         move.l    a4,h_Data(a0)
  148.  
  149.         move.l    #-1,d0                ; Get signal for dumping
  150.         CALLSYS    AllocSignal
  151.         move.l    d0,GfxDumpSig(a4)
  152.         tst.l    d0
  153.         blt.s    .Error
  154.         moveq    #1,d1
  155.         lsl.l    d0,d1
  156.         move.l    d1,GfxDumpFlag(a4)
  157.  
  158.         sub.l    a1,a1                ; Get pointer to task
  159.         CALLSYS    FindTask
  160.         move.l    d0,PrintProc(a4)
  161.  
  162.         move.l    BackTask(a4),a1
  163.         move.l    #SIGHANDSHAKE,d0
  164.         DOLIB    Signal
  165.  
  166.         tst.l    _LocaleBase(a4)            ; Init locale
  167.         beq.s    .NoLocale
  168.         sub.l    a0,a0
  169.         RELLIB    OpenLocale,_LocaleBase
  170.         move.l    d0,MyLocale
  171.         sub.l    a0,a0
  172.         lea    CatalogName(pc),a1
  173.         sub.l    a2,a2
  174.         DOLIB    OpenCatalogA
  175.         move.l    d0,MyCatalog
  176.  
  177. .NoLocale    bsr    DumpScreen
  178.         clr.l    PrintProc(a4)
  179. .Error        CALLSYS    Forbid
  180.  
  181.         tst.l    MyCatalog            ; Close Catalog
  182.         beq.s    .NoCat
  183.         move.l    MyCatalog(pc),a0
  184.         RELLIB    CloseCatalog,_LocaleBase
  185.         move.l    MyLocale(pc),a0
  186.         DOLIB    CloseLocale
  187.  
  188. .NoCat        tst.l    GfxDumpSig(a4)            ; Clear signal
  189.         blt.s    .NoSig
  190.         move.l    GfxDumpSig(a4),d0
  191.         CALLSYS    FreeSignal
  192.         clr.l    GfxDumpSig(a4)
  193.         clr.l    GfxDumpFlag(a4)
  194.  
  195. .NoSig        move.l    BackTask(a4),a1            ; Reply to mother
  196.         move.l    #SIGHANDSHAKE,d0
  197.         CALLSYS    Signal
  198.  
  199. .EndPrg        CALLSYS    Forbid
  200.  
  201.         tst.l    MyWBMsg
  202.         beq.s    .NoWBMsg
  203.         move.l    MyWBMsg(pc),a1
  204.         CALLSYS    ReplyMsg
  205. .NoWBMsg    movem.l    (sp)+,RegsAll
  206.         moveq    #0,d0
  207.         rts
  208. MyWBMsg        dc.l    0
  209. ZeroBase    dc.l    0
  210. DosName        dc.b    "dos.library",0
  211. IntName        dc.b    "intuition.library",0
  212. CatalogName    dc.b    "kcxdump.catalog",0
  213. BackPortName    dc.b    "KCX-BackPort",0
  214. OkGadget    dc.b    "Ok",0
  215.         EVEN
  216. NoBackRequest    dc.l    es_SIZEOF
  217.         dc.l    0
  218.         dc.l    0
  219.         dc.l    0
  220.         dc.l    OkGadget
  221. MyLocale    dc.l    0
  222. MyCatalog    dc.l    0
  223.  
  224.  
  225.  
  226. **********************************************************************
  227. *                      Dump the current screen                       *
  228. **********************************************************************
  229. DumpScreen    bsr    GetNewSource
  230.         bsr    HandleDumpWin
  231.         tst.l    d0
  232.         bne.s    .GoPrint
  233.         bsr    CloseDumpWin
  234.         rts
  235.  
  236. .GoPrint    CALLSYS    Forbid                ; Lock everything out while grabbing data
  237.         moveq    #0,d0
  238.         RELLIB    LockIBase,_IntuitionBase
  239.         move.l    d0,a3
  240.  
  241.         clr.w    GfxFileLeft(a4)            ; Set offsets for bitmap
  242.         clr.w    GfxFileTop(a4)
  243.  
  244.         tst.l    GfxSource(a4)
  245.         beq.s    .TakeScreenFile
  246.         move.l    GfxWindow(a4),a0        ; Get info about window
  247.         move.l    wd_WScreen(a0),GfxFileScreen(a4)
  248.         move.w    wd_LeftEdge(a0),d0
  249.         move.w    wd_TopEdge(a0),d1
  250.         add.w    d0,GfxFileLeft(a4)
  251.         add.w    d1,GfxFileTop(a4)
  252.         move.w    wd_Width(a0),GfxFileWidth(a4)
  253.         move.w    wd_Height(a0),GfxFileHeight(a4)
  254.         bra.s    .GotSourceInfo
  255. .TakeScreenFile    move.l    GfxScreen(a4),a0
  256.         move.l    a0,GfxFileScreen(a4)
  257.         move.w    sc_Width(a0),GfxFileWidth(a4)
  258.         move.w    sc_Height(a0),GfxFileHeight(a4)
  259.  
  260. .GotSourceInfo    tst.l    GfxComplete(a4)            ; Correct data for partial dump
  261.         beq.s    .NoPartSave
  262.         move.l    GfxLeft(a4),d0
  263.         move.l    GfxTop(a4),d1
  264.         add.w    d0,GfxFileLeft(a4)
  265.         add.w    d1,GfxFileTop(a4)
  266.         move.l    GfxWidth(a4),d0
  267.         move.l    GfxHeight(a4),d1
  268.         move.w    d0,GfxFileWidth(a4)
  269.         move.w    d1,GfxFileHeight(a4)
  270.  
  271. .NoPartSave    lea    GfxFileBitMap(a4),a0        ; Clear BitMap structure
  272.         move.w    #(bm_SIZEOF>>1)-1,d7
  273. .ClearBM    clr.w    (a0)+
  274.         dbf    d7,.ClearBM
  275.  
  276.         lea    GfxFileBitMap(a4),a0        ; Initialize BitMap Structure
  277.         move.l    GfxFileScreen(a4),a2
  278.         moveq    #0,d0
  279.         move.b    sc_BitMap+bm_Depth(a2),d0
  280.         move.w    GfxFileWidth(a4),d1
  281.         move.w    GfxFileHeight(a4),d2
  282.         RELLIB    InitBitMap,_GfxBase
  283.  
  284.         lea    GfxFileRPort(a4),a1        ; Initialize our rastport
  285.         DOLIB    InitRastPort
  286.  
  287.         lea    GfxFileRPort(a4),a0        ; Link Bitmap into RastPort
  288.         lea    GfxFileBitMap(a4),a1
  289.         move.l    a1,rp_BitMap(a0)
  290.  
  291.         move.l    #MEMORY_ERR,ErrorPrint(a4)    ; Try to allocate Planes
  292.         lea    GfxFileBitMap(a4),a2
  293.         moveq    #0,d0
  294.         move.w    bm_BytesPerRow(a2),d0
  295.         moveq    #0,d1
  296.         move.w    bm_Rows(a2),d1
  297.         RELLIB    UMult32,_UtilityBase
  298.         move.l    d0,d6
  299.         moveq    #0,d7
  300.         move.b    bm_Depth(a2),d7
  301.         subq.w    #1,d7
  302.         lea    bm_Planes(a2),a2
  303. .GetBitPlanes    move.l    d6,d0
  304.         move.l    #MEMF_CHIP|MEMF_CLEAR,d1
  305.         CALLSYS    AllocVec
  306.         tst.l    d0
  307.         bne.s    .GotPlane
  308. .AllocErr    move.l    a3,a0
  309.         RELLIB    UnlockIBase,_IntuitionBase
  310.         CALLSYS    Permit
  311.         bsr    DisplayError
  312.         bra    .EndDumping
  313. .GotPlane    move.l    d0,(a2)+            ; Store address to plane
  314.         dbf    d7,.GetBitPlanes
  315.  
  316.         RELLIB    WaitBlit,_GfxBase
  317.         move.l    GfxFileScreen(a4),a0        ; Copy BitMap
  318.         move.l    sc_RastPort+rp_BitMap(a0),a0    ; To destination bitmap
  319.         lea    GfxFileBitMap(a4),a1        ; in that way the needed
  320.         moveq    #0,d0                ; data is automatically
  321.         moveq    #0,d1                ; stored in the proper format
  322.         moveq    #0,d4
  323.         moveq    #0,d5
  324.         move.w    GfxFileLeft(a4),d0
  325.         move.w    GfxFileTop(a4),d1
  326.         move.w    GfxFileWidth(a4),d4
  327.         move.w    GfxFileHeight(a4),d5
  328.         moveq    #0,d2
  329.         moveq    #0,d3
  330.         move.l    #$c0,d6
  331.         moveq    #-1,d7
  332.         sub.l    a2,a2
  333.         DOLIB    BltBitMap
  334.         move.l    a3,a0
  335.         RELLIB    UnlockIBase,_IntuitionBase
  336.         CALLSYS    Permit
  337.  
  338.         lea    GfxFileBitMap(a4),a0
  339.         moveq    #0,d0
  340.         move.w    bm_BytesPerRow(a0),d0
  341.         lsl.l    #1,d0
  342.         move.l    #MEMF_CLEAR,d1
  343.         CALLSYS    AllocVec
  344.         move.l    d0,PackedRow
  345.         tst.l    d0
  346.         beq    .AllocErr
  347.  
  348. * Now to the real dump
  349.  
  350.         move.l    PrintHandle(a4),a1        ; Turn off all gadgets not needed
  351.         lea    PrintGads(a4),a0
  352.         lea    DisableList(pc),a2
  353.         moveq    #1,d1
  354. .Disable    move.l    (a2)+,d0
  355.         blt.s    .AllOff
  356.         RELLIB    GhostGadget,_KCXBase
  357.         bra.s    .Disable
  358.  
  359. .AllOff        tst.l    GfxDumpType(a4)            ; Dump to file or printer ???
  360.         beq    .DumpToPrinter
  361.  
  362.         move.l    #GD_GfxCancel,d0        ; Additionally turn off Cancel gadget
  363.         DOLIB    GhostGadget
  364.  
  365.         move.l    #NOIFF_ERR,ErrorPrint(a4)    ; Allocate IFF-Handle
  366.         RELLIB    AllocIFF,_IFFParseBase
  367.         move.l    d0,GfxFileHandle(a4)
  368.         tst.l    d0
  369.         beq    .FileError1
  370.  
  371.         lea    PrintFileName(pc),a0        ; Try to open dump file
  372.         move.l    a0,d1
  373.         move.l    d1,PrintErrArg(a4)
  374.         move.l    #MODE_NEWFILE,d2
  375.         RELLIB    Open,_DOSBase
  376.         tst.l    d0
  377.         beq    .DosError
  378.  
  379.         move.l    GfxFileHandle(a4),a0        ; Init IFF-Handle
  380.         move.l    d0,iff_Stream(a0)
  381.         RELLIB    InitIFFasDOS,_IFFParseBase
  382.  
  383.         move.l    GfxFileHandle(a4),a0        ; Open IFF for write
  384.         move.l    #IFFF_WRITE,d0
  385.         DOLIB    OpenIFF
  386.         tst.l    d0
  387.         bne    .FileError
  388.  
  389.         move.l    GfxFileHandle(a4),a0        ; Push FORM Chunk
  390.         move.l    #'ILBM',d0
  391.         move.l    #'FORM',d1
  392.         move.l    #IFFSIZE_UNKNOWN,d2
  393.         DOLIB    PushChunk
  394.         tst.l    d0
  395.         bne    .FileError
  396.  
  397.         move.l    GfxFileHandle(a4),a0        ; Push BitMap Header
  398.         move.l    #'ILBM',d0
  399.         move.l    #'BMHD',d1
  400.         move.l    #IFFSIZE_UNKNOWN,d2
  401.         DOLIB    PushChunk
  402.         tst.l    d0
  403.         bne    .FileError
  404.  
  405.         move.l    GfxFileHandle(a4),a0
  406.         lea    BMHDChunk(pc),a1
  407.         move.w    GfxFileWidth(a4),bmh_Width(a1)    ; Get width/height of area
  408.         move.w    GfxFileHeight(a4),bmh_Height(a1)
  409.         clr.w    bmh_Left(a1)            ; Clear offsets to image
  410.         clr.w    bmh_Top(a1)
  411.         move.l    GfxScreen(a4),a2        ; Store depth of BitMap
  412.         move.b    sc_BitMap+bm_Depth(a2),bmh_Depth(a1)
  413.         clr.b    bmh_Masking(a1)            ; No masking/tranp.color
  414.         move.b    #1,bmh_Compression(a1)        ; Do compression
  415.         clr.w    bmh_Transparent(a1)
  416.         move.b    #10,bmh_XAspect(a1)        ; Store aspect
  417.         move.b    #11,bmh_YAspect(a1)
  418.         move.w    sc_Width(a2),bmh_PageWidth(a1)    ; And screen size
  419.         move.w    sc_Height(a2),bmh_PageHeight(a1)
  420.         move.l    #BitMapHeader_SIZEOF,d0        ; Write header
  421.         DOLIB    WriteChunkBytes
  422.         cmp.l    #BitMapHeader_SIZEOF,d0
  423.         bne    .FileError
  424.  
  425.         move.l    GfxFileHandle(a4),a0
  426.         DOLIB    PopChunk
  427.         tst.l    d0
  428.         bne    .FileError
  429.  
  430.         move.l    GfxFileHandle(a4),a0        ; Push colors
  431.         move.l    #'ILBM',d0
  432.         move.l    #'CMAP',d1
  433.         move.l    #IFFSIZE_UNKNOWN,d2
  434.         DOLIB    PushChunk
  435.         tst.l    d0
  436.         bne    .FileError
  437.  
  438.         move.l    GfxFileScreen(a4),a2
  439.         moveq    #0,d0
  440.         moveq    #1,d7
  441.         move.b    sc_BitMap+bm_Depth(a2),d0    ; Get depth
  442.         lsl.l    d0,d7
  443.         subq.w    #1,d7                ; Get number of colors
  444.         moveq    #0,d6
  445.         move.l    sc_ViewPort+vp_ColorMap(a2),a2    ; Get address of ColorMap
  446. .GetColors    move.l    a2,a0
  447.         move.l    d6,d0
  448.         RELLIB    GetRGB4,_GfxBase        ; Get color value for register
  449.         move.l    GfxFileHandle(a4),a0
  450.         lea    PrintFileCols(pc),a1        ; Calculate IFF RGB colors (R0G0B0)
  451.         move.w    d0,d1
  452.         and.w    #$0f00,d1
  453.         lsr.w    #4,d1
  454.         move.b    d1,(a1)
  455.         move.w    d0,d1
  456.         and.w    #$00f0,d1
  457.         move.b    d1,1(a1)
  458.         and.w    #$000f,d0
  459.         lsl.w    #4,d0
  460.         move.b    d0,2(a1)
  461.         moveq    #3,d0
  462.         RELLIB    WriteChunkBytes,_IFFParseBase    ; Write bytes
  463.         cmp.l    #3,d0
  464.         bne    .FileError
  465.         addq.l    #1,d6
  466.         dbf    d7,.GetColors
  467.  
  468.         move.l    GfxFileHandle(a4),a0        ; Pop CMAP Chunk
  469.         DOLIB    PopChunk
  470.         tst.l    d0
  471.         bne    .FileError
  472.  
  473.         move.l    GfxFileHandle(a4),a0        ; Push CAMG Chunk
  474.         move.l    #'ILBM',d0
  475.         move.l    #'CAMG',d1
  476.         move.l    #IFFSIZE_UNKNOWN,d2
  477.         DOLIB    PushChunk
  478.         tst.l    d0
  479.         bne    .FileError
  480.  
  481.         move.l    GfxFileScreen(a4),a0        ; Write ViewPort mode
  482.         lea    sc_ViewPort(a0),a0
  483.         RELLIB    GetVPModeID,_GfxBase
  484.         move.l    d0,CMAPVal
  485.         move.l    GfxFileHandle(a4),a0
  486.         lea    CMAPVal(pc),a1
  487.         moveq    #4,d0
  488.         RELLIB    WriteChunkBytes,_IFFParseBase
  489.         cmp.l    #4,d0
  490.         bne    .FileError
  491.  
  492.         move.l    GfxFileHandle(a4),a0        ; Pop Chunk
  493.         DOLIB    PopChunk
  494.         tst.l    d0
  495.         bne    .FileError
  496.  
  497.         move.l    GfxFileHandle(a4),a0        ; Now for BODY
  498.         move.l    #'ILBM',d0
  499.         move.l    #'BODY',d1
  500.         move.l    #IFFSIZE_UNKNOWN,d2
  501.         DOLIB    PushChunk
  502.         tst.l    d0
  503.         bne    .FileError
  504.  
  505.         moveq    #0,d4                ; Clear line counter
  506.         move.w    GfxFileHeight(a4),d5        ; Get number of lines
  507.         subq.w    #1,d5
  508. .LoopLines    lea    GfxFileBitMap(a4),a2
  509.         moveq    #0,d7
  510.         move.b    bm_Depth(a2),d7            ; Get number of planes
  511.         subq.w    #1,d7
  512.         move.w    bm_BytesPerRow(a2),d6        ; Get number of bytes per row
  513.         lea    bm_Planes(a2),a2
  514. .LoopPlanes    move.l    d6,d0                ; Calc offset to line
  515.         move.l    d4,d1
  516.         RELLIB    UMult32,_UtilityBase
  517.         lea    PackedRow(pc),a0
  518.         move.l    (a0),d3                ; Get address (is to be restored)
  519.         move.l    (a2)+,a1            ; Get address of bitplane
  520.         add.l    d0,a1                ; Get correct address of line
  521.         move.l    a1,FromPtr            ; Store within pointer to pointer
  522.         move.l    d6,-(sp)            ; Store length of line
  523.         move.l    a0,-(sp)            ; Source address
  524.         lea    FromPtr(pc),a0            ; Get pointer to pointer
  525.         move.l    a0,-(sp)
  526.         bsr    _packrow
  527.         move.l    d3,PackedRow            ; Remake pointer
  528.         lea    12(sp),sp
  529.         move.l    GfxFileHandle(a4),a0        ; Save packed row
  530.         move.l    PackedRow(pc),a1
  531.         move.l    d0,d2
  532.         RELLIB    WriteChunkBytes,_IFFParseBase    ; Write line
  533.         cmp.l    d2,d0
  534.         bne.s    .FileError
  535.         dbf    d7,.LoopPlanes            ; Loop for planes
  536.         addq.l    #1,d4
  537.         dbf    d5,.LoopLines            ; Loop for lines
  538.  
  539.         move.l    GfxFileHandle(a4),a0        ; Pop body chunk
  540.         DOLIB    PopChunk
  541.         tst.l    d0
  542.         bne.s    .FileError
  543.  
  544.         move.l    GfxFileHandle(a4),a0
  545.         DOLIB    PopChunk
  546.  
  547. .FileError    tst.l    d0                ; Error code ?
  548.         beq.s    .EndFile
  549.         neg.l    d0                ; Convert to internal error code
  550.         add.l    #400,d0
  551.         move.l    d0,ErrorPrint(a4)
  552. .FileError1    bsr    DisplayError
  553.         bra.s    .EndFile
  554. .DosError    RELLIB    IoErr,_DOSBase            ; Display error
  555.         move.l    d0,ErrorPrint(a4)
  556.         bsr    DisplayError
  557. .EndFile    tst.l    GfxFileHandle(a4)        ; Did we have a handle ?
  558.         beq.s    .NoHandle
  559.         move.l    GfxFileHandle(a4),a0        ; Close IFF
  560.         RELLIB    CloseIFF,_IFFParseBase
  561.         move.l    GfxFileHandle(a4),a0
  562.         tst.l    iff_Stream(a0)
  563.         beq.s    .NoStream
  564.         move.l    iff_Stream(a0),d1        ; Close DOS-Handle
  565.         RELLIB    Close,_DOSBase
  566. .NoStream    move.l    GfxFileHandle(a4),a0        ; Free IFF-Handle
  567.         RELLIB    FreeIFF,_IFFParseBase
  568. .NoHandle    bra    .EndDumping
  569.  
  570.  
  571. * Now we dump to the printer
  572.  
  573. .DumpToPrinter    CALLSYS    CreateMsgPort            ; Try to get MsgPort for Printer device
  574.         move.l    d0,PrintPort(a4)
  575.         tst.l    d0
  576.         beq    .PrintError
  577.  
  578.         move.l    d0,a0                ; Get Request block for dump-rastport
  579.         clr.l    LN_NAME(a0)
  580.         clr.b    LN_PRI(a0)
  581.         move.l    #iodrpr_SIZEOF,d0
  582.         DOLIB    CreateIORequest
  583.         move.l    d0,PrintReq(a4)
  584.         tst.l    d0
  585.         beq    .PrintError
  586.  
  587.         lea    PrintName(pc),a0        ; Try to open device
  588.         moveq    #0,d0
  589.         move.l    PrintReq(a4),a1
  590.         moveq    #0,d1
  591.         DOLIB    OpenDevice
  592.         tst.l    d0
  593.         bne    .PrintError
  594.         move.l    PrintReq(a4),a0
  595.         move.l    IO_DEVICE(a0),a0
  596.         move.l    pd_SegmentData(a0),a0
  597.         lea    ps_PED(a0),a0
  598.         move.l    ped_PrinterName(a0),a0
  599.         lea    ThisPrinter(a4),a1
  600.         bsr    StrCpy
  601.  
  602.         move.l    PrintReq(a4),a1            ; Do the printing, set prefs
  603.         move.l    IO_DEVICE(a1),a0
  604.         lea    pd_Preferences(a0),a0
  605.         move.l    GfxImage(a4),d0            ; Set image
  606.         move.w    d0,pf_PrintImage(a0)
  607.         move.l    GfxAspect(a4),d0
  608.         move.w    d0,pf_PrintAspect(a0)
  609.         lea    ShadeFlags,a2
  610.         move.l    GfxShade(a4),d0            ; Set shading
  611.         add.w    d0,d0
  612.         move.l    0(a2,d0.w),pf_PrintShade(a0)
  613.         move.l    GfxThreshold(a4),d0        ; Set threshold
  614.         move.w    d0,pf_PrintThreshold(a0)
  615.         moveq    #0,d0                ; Set Flags
  616.         cmp.l    #3,GfxShade(a4)            ; Color enabled ?
  617.         bne.s    .NoCols
  618.         tst.b    GfxRed(a4)            ; red set ?
  619.         beq.s    .NoRed
  620.         or.w    #CORRECT_RED,d0
  621. .NoRed        tst.b    GfxGreen(a4)            ; green set ?
  622.         beq.s    .NoGreen
  623.         or.w    #CORRECT_GREEN,d0
  624. .NoGreen    tst.b    GfxBlue(a4)            ; blue set ?
  625.         beq.s    .NoCols
  626.         or.w    #CORRECT_BLUE,d0
  627. .NoCols        lea    DitherFlags,a2            ; Set dithering
  628.         move.l    GfxDithering(a4),d1
  629.         cmp.l    #2,d1                ; Floyd selected ?
  630.         beq.s    .NoSmooth
  631.         tst.b    GfxSmooth(a4)            ; Set smoothing
  632.         beq.s    .NoSmooth
  633.         or.w    #ANTI_ALIAS,d0
  634. .NoSmooth    add.w    d1,d1                ; Set dither flags
  635.         or.w    0(a2,d1.w),d0
  636.         move.w    d0,pf_PrintFlags(a0)
  637.         move.l    GfxDensity(a4),d0        ; Set density
  638.         move.b    d0,pf_PrintDensity(a0)
  639.  
  640.         move.w    #CMD_WRITE,IO_COMMAND(a1)    ; Init printer
  641.         lea    PrintInit(pc),a0
  642.         move.l    a0,IO_DATA(a1)
  643.         move.l    #-1,IO_LENGTH(a1)
  644.         CALLSYS    DoIO
  645.         tst.b    d0
  646.         bne    .PrintError1
  647.  
  648.         move.l    PrintReq(a4),a1            ; Initialize source
  649.         lea    GfxFileRPort(a4),a0        ; to our own RastPort
  650.         move.l    a0,io_RastPort(a1)
  651.         clr.w    io_SrcX(a1)
  652.         clr.w    io_SrcY(a1)
  653.         move.w    GfxFileWidth(a4),io_SrcWidth(a1)
  654.         move.w    GfxFileHeight(a4),io_SrcHeight(a1)
  655.         move.l    GfxFileScreen(a4),a0
  656.         lea    sc_ViewPort(a0),a0
  657.         move.l    vp_ColorMap(a0),io_ColorMap(a1)    ; And ViewPort dependant stuff
  658.         move.l    a1,-(sp)
  659.         RELLIB    GetVPModeID,_GfxBase
  660.         move.l    (sp)+,a1
  661.         move.l    d0,io_Modes(a1)
  662.  
  663.         move.w    #SPECIAL_TRUSTME,d0        ; Set special flags
  664.         tst.b    GfxKeepAspect(a4)
  665.         beq.s    .NoAspect
  666.         or.w    #SPECIAL_ASPECT,d0
  667. .NoAspect    tst.b    GfxCenter(a4)            ; Center ?
  668.         beq.s    .NoCenterPic
  669.         or.w    #SPECIAL_CENTER,d0
  670. .NoCenterPic    tst.b    GfxFormFeed(a4)            ; Formfeed ?
  671.         bne.s    .NoFormFeed
  672.         or.w    #SPECIAL_NOFORMFEED,d0
  673. .NoFormFeed    tst.l    GfxScale(a4)            ; Print inches ?
  674.         bne.s    .NoInchPage
  675.         or.w    #SPECIAL_MILCOLS|SPECIAL_MILROWS,d0
  676.         movem.l    d0/a1,-(sp)
  677.         move.l    GfxOutWidth(a4),d0
  678.         move.l    #1000,d1
  679.         RELLIB    UMult32,_UtilityBase
  680.         move.l    d0,io_DestCols(a1)
  681.         move.l    GfxOutHeight(a4),d0
  682.         move.l    #1000,d1
  683.         RELLIB    UMult32,_UtilityBase
  684.         move.l    d0,io_DestRows(a1)
  685.         movem.l    (sp)+,d0/a1
  686. .NoInchPage    cmp.l    #1,GfxScale(a4)            ; Print in mm ?
  687.         bne.s    .NoMMPage
  688.         or.w    #SPECIAL_MILCOLS|SPECIAL_MILROWS,d0
  689.         movem.l    d0/a1,-(sp)
  690.         move.l    GfxOutWidth(a4),d0
  691.         move.l    #10000,d1
  692.         RELLIB    UMult32,_UtilityBase
  693.         move.l    #254,d1
  694.         DOLIB    UDivMod32
  695.         move.l    d0,d6
  696.         move.l    GfxOutHeight(a4),d0
  697.         move.l    #10000,d1
  698.         DOLIB    UMult32
  699.         move.l    #254,d1
  700.         DOLIB    UDivMod32
  701.         move.l    d0,d7
  702.         movem.l    (sp)+,d0/a1
  703.         addq.l    #1,d6
  704.         addq.l    #1,d7
  705.         move.l    d6,io_DestCols(a1)
  706.         move.l    d7,io_DestRows(a1)
  707. .NoMMPage    cmp.l    #2,GfxScale(a4)            ; Print in cm ?
  708.         bne.s    .NoCMPage
  709.         or.w    #SPECIAL_MILCOLS|SPECIAL_MILROWS,d0
  710.         movem.l    d0/a1,-(sp)
  711.         move.l    GfxOutWidth(a4),d0
  712.         move.l    #100000,d1
  713.         RELLIB    UMult32,_UtilityBase
  714.         move.l    #254,d1
  715.         DOLIB    UDivMod32
  716.         move.l    d0,d6
  717.         move.l    GfxOutHeight(a4),d0
  718.         move.l    #100000,d1
  719.         DOLIB    UMult32
  720.         move.l    #254,d1
  721.         DOLIB    UDivMod32
  722.         move.l    d0,d7
  723.         movem.l    (sp)+,d0/a1
  724.         addq.l    #1,d6
  725.         addq.l    #1,d7
  726.         move.l    d6,io_DestCols(a1)
  727.         move.l    d7,io_DestRows(a1)
  728. .NoCMPage    cmp.l    #3,GfxScale(a4)            ; Fraction of full width/height ?
  729.         bne.s    .NoFracPage
  730.         or.w    #SPECIAL_FRACCOLS|SPECIAL_FRACROWS,d0
  731.         movem.l    d0/a1,-(sp)
  732.         move.l    #$64,d0
  733.         move.l    GfxOutWidth(a4),d1
  734.         RELLIB    UDivMod32,_UtilityBase
  735.         move.l    d0,d1
  736.         moveq    #-1,d0
  737.         DOLIB    UDivMod32
  738.         move.l    d0,d6
  739.         move.l    #$64,d0
  740.         move.l    GfxOutHeight(a4),d1
  741.         DOLIB    UDivMod32
  742.         move.l    d0,d1
  743.         moveq    #-1,d0
  744.         DOLIB    UDivMod32
  745.         move.l    d0,d7
  746.         movem.l    (sp)+,d0/a1
  747.         move.l    d6,io_DestCols(a1)
  748.         move.l    d7,io_DestRows(a1)
  749. .NoFracPage    cmp.l    #4,GfxScale(a4)            ; Selected Full Page ?
  750.         bne.s    .NoFullPage
  751.         or.w    #SPECIAL_FULLCOLS|SPECIAL_FULLROWS,d0
  752.         move.l    #-1,io_DestCols(a1)
  753.         move.l    #-1,io_DestRows(a1)
  754. .NoFullPage    move.l    GfxDensity(a4),d1        ; Set density
  755.         lsl.l    #8,d1
  756.         or.w    d1,d0
  757.         move.w    d0,io_Special(a1)
  758.         move.w    #PRD_DUMPRPORT,IO_COMMAND(a1)
  759.         CALLSYS    SendIO
  760.  
  761.         move.l    PrintHandle(a4),a0        ; Set window title
  762.         LOCLEA    GfxDumpingTitle(pc),a1
  763.         move.l    #~0,a2
  764.         RELLIB    SetWindowTitles,_IntuitionBase
  765.  
  766.         move.l    PrintHandle(a4),a0        ; First clear all messages on WindowPort
  767.         move.l    wd_UserPort(a0),a2
  768. .Clear        move.l    a2,a0
  769.         RELLIB    GT_GetIMsg,_GadToolsBase
  770.         tst.l    d0
  771.         beq.s    .AllGone
  772.         move.l    d0,a1
  773.         DOLIB    GT_ReplyIMsg
  774.         bra.s    .Clear
  775.  
  776. .AllGone    moveq    #0,d0
  777.         moveq    #1,d1
  778.         move.b    MP_SIGBIT(a2),d0
  779.         lsl.l    d0,d1
  780.         move.l    d1,d7
  781.         move.l    PrintPort(a4),a0        ; Get SigFlag of PrinterPort
  782.         moveq    #0,d2
  783.         moveq    #1,d0
  784.         move.b    MP_SIGBIT(a0),d2
  785.         lsl.l    d2,d0
  786.         or.l    d1,d0
  787.         move.l    d0,d6                ; Copy flags
  788. .ReWait        move.l    d6,d0                ; Restore flags
  789.         CALLSYS    Wait                ; Wait for signals
  790.         moveq    #0,d5
  791.         move.l    d0,-(sp)            ; Store return signal
  792.         and.l    d7,d0                ; From window ?
  793.         beq.s    .NoDisable            ; Nope -> must be printer
  794. .CheckMsgs    move.l    a2,a0                ; Get Message from window port
  795.         RELLIB    GT_GetIMsg,_GadToolsBase
  796.         move.l    d0,a1
  797.         tst.l    d0
  798.         beq.s    .NoMsg                ; No more messages return to wait
  799.         move.l    im_Class(a1),d4            ; Get class and code
  800.         move.w    im_Code(a1),d3
  801.         cmp.w    #'a',d3
  802.         blt.s    .End
  803.         cmp.w    #'z',d3
  804.         bgt.s    .End
  805.         and.w    #~$20,d3
  806. .End        DOLIB    GT_ReplyIMsg            ; Reply message
  807.         cmp.l    #IDCMP_GADGETUP,d4        ; Gadget released ???
  808.         bne.s    .NoGadget            ; Yep -> abort
  809.         moveq    #1,d5
  810.         bra.s    .NoDisable
  811. .NoGadget    cmp.l    #IDCMP_VANILLAKEY,d4        ; Key pressed ???
  812.         bne.s    .CheckMsgs            ; Nope -> Next message
  813.         move.l    #GD_GfxCancel,d0
  814.         lea    PrintGads(a4),a0
  815.         RELLIB    GetGadgetPtr,_KCXBase
  816.         move.l    gg_UserData(a0),d0
  817.         cmp.b    d0,d3
  818.         bne    .CheckMsgs
  819.         move.l    #GD_GfxCancel,d0        ; Give visual feedback
  820.         lea    PrintGads(a4),a0
  821.         move.l    PrintHandle(a4),a5
  822.         bsr    ButtonCheck
  823.         moveq    #1,d5
  824.         bra.s    .NoDisable            ; Do abort
  825. .NoMsg        move.l    (sp)+,d0
  826.         bra    .ReWait
  827. .NoDisable    move.l    (sp)+,d0            ; Abort dump
  828.         move.l    d0,-(sp)
  829.         move.l    PrintReq(a4),a1
  830.         CALLSYS    AbortIO
  831.         move.l    PrintReq(a4),a1
  832.         DOLIB    WaitIO
  833.         move.l    (sp)+,d0
  834.  
  835.         tst.l    d5
  836.         beq.s    .NoAbort
  837.         move.l    #PDERR_CANCEL+500,ErrorPrint(a4)
  838.         bra.s    .PrintError2
  839.  
  840. .NoAbort    move.l    PrintReq(a4),a1            ; Check for error
  841.         tst.b    IO_ERROR(a1)
  842.         bne.s    .PrintError1
  843.  
  844.         tst.b    GfxFormFeed(a4)
  845.         beq.s    .NoPrint
  846.         move.w    #CMD_WRITE,IO_COMMAND(a1)
  847.         lea    PrintFFeed(pc),a0
  848.         move.l    a0,IO_DATA(a1)
  849.         move.l    #-1,IO_LENGTH(a1)
  850.         CALLSYS    DoIO
  851.         tst.b    d0
  852.         beq.s    .NoPrint
  853.  
  854. .PrintError1    move.l    PrintReq(a4),a0            ; Display printer error
  855.         moveq    #0,d0
  856.         move.b    IO_ERROR(a0),d0
  857.         add.l    #500,d0
  858.         move.l    d0,ErrorPrint(a4)
  859. .PrintError2    lea    ThisPrinter(a4),a0
  860.         move.l    a0,PrintErrArg(a4)
  861.         bsr    DisplayError
  862.         bra.s    .NoPrint
  863. .PrintError
  864.         move.l    #NOPRINT_ERR,ErrorPrint(a4)    ; Display open error
  865.         bsr    DisplayError
  866. .NoPrint    tst.l    PrintReq(a4)            ; Close resources
  867.         beq.s    .NoReq
  868.         move.l    PrintReq(a4),a1
  869.         tst.l    IO_DEVICE(a1)
  870.         beq.s    .NoDevice
  871.         CALLSYS    CloseDevice
  872. .NoDevice    move.l    PrintReq(a4),a0
  873.         CALLSYS    DeleteIORequest
  874. .NoReq        tst.l    PrintPort(a4)
  875.         beq.s    .NoPort
  876.         move.l    PrintPort(a4),a0
  877.         CALLSYS    DeleteMsgPort
  878. .NoPort        clr.l    PrintPort(a4)
  879.         clr.l    PrintReq(a4)
  880.  
  881. .EndDumping    lea    GfxFileBitMap(a4),a2        ; Check for any BitPlanes
  882.         moveq    #0,d7
  883.         move.b    bm_Depth(a2),d7
  884.         beq.s    .NoMaps
  885.         subq.w    #1,d7
  886.         lea    bm_Planes(a2),a2
  887. .FreeBitPlanes    move.l    (a2)+,d0
  888.         beq.s    .NoFree
  889.         move.l    d0,a1
  890.         CALLSYS    FreeVec
  891. .NoFree        dbf    d7,.FreeBitPlanes
  892. .NoMaps        tst.l    PackedRow
  893.         beq.s    .NoPacked
  894.         move.l    PackedRow(pc),a1
  895.         CALLSYS    FreeVec
  896. .NoPacked    clr.l    GfxFileHandle(a4)
  897.         bsr    CloseDumpWin
  898.         rts
  899. PrintName    dc.b    "printer.device",0
  900. PrintInit    dc.b    27,"#1",0
  901. PrintFFeed    dc.b    12,0
  902.         EVEN
  903.  
  904.  
  905.  
  906.  
  907. **********************************************************************
  908. *                       Handle the Dump window                       *
  909. **********************************************************************
  910. HandleDumpWin    link    a5,#-(4+4+2+2+2+2+gng_SIZEOF)
  911.         lea    PrintTxt(a4),a0
  912.         move.l    a0,FontPtr(a5)
  913.  
  914.         bsr    OpenPrintScreen
  915.         move.l    d0,PrintScreen(a4)
  916.         tst.l    d0
  917.         beq    .PrintWinError
  918.         move.l    d0,-4(a5)
  919.         moveq    #0,d2
  920.         moveq    #0,d3
  921.         RELLIB    ComputeFont,_KCXBase
  922.         move.l    -4(a5),a0
  923.         sub.l    a1,a1
  924.         RELLIB    GetVisualInfoA,_GadToolsBase
  925.         move.l    d0,PrintVisInfo(a4)
  926.         beq    .PrintWinError
  927.  
  928.         move.l    -4(a5),a0
  929.         moveq    #0,d3
  930.         moveq    #0,d2
  931.         move.w    PrintWinWidth(a4),d2
  932.         move.w    PrintWinHeight(a4),d3
  933.         RELLIB    ComputeFont,_KCXBase
  934.         move.l    -4(a5),a0
  935.         move.l    d2,d0
  936.         DOLIB    ComputeX
  937.         move.l    d0,d4
  938.         move.w    PrintWinLeft(a4),d2
  939.         add.w    d2,d0
  940.         add.w    OffX(a5),d0
  941.         moveq    #0,d1
  942.         move.b    sc_WBorRight(a0),d1
  943.         add.w    d1,d0
  944.         cmp.w    sc_Width(a0),d0
  945.         bls.s    .WOk
  946.         move.w    sc_Width(a0),d0
  947.         sub.w    d4,d0
  948.         move.w    d0,d2
  949. .WOk        move.l    d3,d0
  950.         DOLIB    ComputeY
  951.         move.l    d0,d4
  952.         move.w    PrintWinTop(a4),d3
  953.         add.w    d3,d0
  954.         add.w    OffY(a5),d0
  955.         moveq    #0,d1
  956.         move.b    sc_WBorBottom(a0),d1
  957.         add.w    d1,d0
  958.         cmp.w    sc_Height(a0),d0
  959.         bls.s    .HOk
  960.         move.w    sc_Height(a0),d0
  961.         sub.w    d4,d0
  962.         move.w    d0,d3
  963. .HOk        lea.l    PrintGadget(a4),a0
  964.         RELLIB    CreateContext,_GadToolsBase
  965.         move.l    d0,a3
  966.         beq    .PrintWinError
  967.  
  968.         movem.l d2-d3/a4,-(sp)
  969.         moveq    #0,d3
  970.         lea.l    PrintWinGTags,a4
  971. .PrintWinGL    lea.l    PrintWinNGads,a0
  972.         move.l    d3,d0
  973.         mulu    #gng_SIZEOF,d0
  974.         add.l    d0,a0
  975.         lea.l    -(4+4+2+2+2+2+gng_SIZEOF)(a5),a1
  976.         moveq    #gng_SIZEOF,d0
  977.         CALLSYS    CopyMem
  978.         lea.l    -(4+4+2+2+2+2+gng_SIZEOF)(a5),a0
  979.         move.l    a4,-(sp)
  980.         move.l    ZeroBase(pc),a4
  981.         move.l    gng_GadgetText(a0),-(sp)
  982.         bsr    GetLocStr
  983.         move.l    (sp)+,d7
  984.         move.l    d7,gng_GadgetText(a0)
  985.         move.l    PrintVisInfo(a4),gng_VisualInfo(a0)
  986.         move.l    FontPtr(a5),gng_TextAttr(a0)
  987.         move.w    gng_LeftEdge(a0),d0
  988.         RELLIB    ComputeX,_KCXBase
  989.         move.l    (sp)+,a4
  990.         add.w    OffX(a5),d0
  991.         move.w    d0,gng_LeftEdge(a0)
  992.         move.w    gng_TopEdge(a0),d0
  993.         DOLIB    ComputeY
  994.         add.w    OffY(a5),d0
  995.         move.w    d0,gng_TopEdge(a0)
  996.         move.w    gng_Width(a0),d0
  997.         DOLIB    ComputeX
  998.         move.w    d0,gng_Width(a0)
  999.         move.w    gng_Height(a0),d0
  1000.         DOLIB    ComputeY
  1001.         move.w    d0,gng_Height(a0)
  1002.         lea.l    PrintWinGTypes,a0
  1003.         moveq    #0,d0
  1004.         move.l    d3,d1
  1005.         lsl.l    #1,d1
  1006.         move.w    0(a0,d1.w),d0
  1007.         move.w    d0,d6
  1008.         lsl.w    #8,d6
  1009.         move.l    a3,a0
  1010.         lea.l    -(4+4+2+2+2+2+gng_SIZEOF)(a5),a1
  1011.         move.l    a4,a2
  1012.         move.l    a4,-(sp)
  1013.         move.l    ZeroBase(pc),a4
  1014.         bsr    LocalizeGadTags
  1015.         RELLIB    CreateGadgetA,_GadToolsBase
  1016.         move.l    (sp)+,a4
  1017.         tst.l    d0
  1018.         beq    .PrintWinError
  1019.         move.l    d0,a3
  1020.         move.l    d7,a0
  1021.         bsr    LocalizeGadKey
  1022.         move.l    d0,a3
  1023.         or.w    d6,d1
  1024.         move.l    d1,gg_UserData(a3)
  1025.         move.l    d3,d0
  1026.         lsl.l    #2,d0
  1027.         move.l    a4,-(sp)
  1028.         move.l    ZeroBase(pc),a4
  1029.         lea.l    PrintGads(a4),a0
  1030.         move.l    (sp)+,a4
  1031.         move.l    a3,0(a0,d0.w)
  1032. .PrintWinTL    tst.l    (a4)
  1033.         beq.s    .PrintWinDN
  1034.         addq.w    #8,a4
  1035.         bra.s    .PrintWinTL
  1036. .PrintWinDN    addq.w    #4,a4
  1037.         addq.w    #1,d3
  1038.         cmp.w    #PrintWin_CNT,d3
  1039.         bmi    .PrintWinGL
  1040.         movem.l (sp)+,d2-d3/a4
  1041.         move.l    PrintGadget(a4),PrintWinWG+4
  1042.  
  1043.         lea    PrintGads(a4),a0
  1044.         bsr    SetStrIntGads
  1045.  
  1046.         LOCLEA    DefPrintTitle,a0
  1047.         lea    PrintTitle(a4),a1
  1048.         move.l    a1,PrintWinWG+12
  1049.         bsr    StrCpy
  1050.         lea    DumpHotKey(a4),a0
  1051.         lea    PrintTitle(a4),a1
  1052.         bsr    StrCat
  1053.         LOCLEA    WindowScrTitle,PrintWinWG+20
  1054.         move.l    -4(a5),PrintWinSC+4        ; Open window
  1055.         ext.l    d2
  1056.         ext.l    d3
  1057.         move.l    d2,PrintWinL+4
  1058.         move.l    d3,PrintWinT+4
  1059.         move.l    -4(a5),a0
  1060.         move.w    PrintWinWidth(a4),d0
  1061.         RELLIB    ComputeX,_KCXBase
  1062.         add.w    OffX(a5),d0
  1063.         moveq    #0,d1
  1064.         move.b    sc_WBorRight(a0),d1
  1065.         add.w    d1,d0
  1066.         move.l    d0,PrintWinW+4
  1067.         move.w    PrintWinHeight(a4),d0
  1068.         DOLIB    ComputeY
  1069.         add.w    OffY(a5),d0
  1070.         moveq    #0,d1
  1071.         move.b    sc_WBorBottom(a0),d1
  1072.         add.w    d1,d0
  1073.         move.l    d0,PrintWinH+4
  1074.         suba.l    a0,a0
  1075.         lea.l    PrintWinWindowTags,a1
  1076.         RELLIB    OpenWindowTagList,_IntuitionBase
  1077.         move.l    d0,PrintHandle(a4)
  1078.         beq.s    .PrintWinError
  1079.  
  1080.         move.l    PrintHandle(a4),a0
  1081.         suba.l    a1,a1
  1082.         RELLIB    GT_RefreshWindow,_GadToolsBase
  1083.  
  1084.         move.l    PrintScreen(a4),a0
  1085.         RELLIB    ScreenToFront,_IntuitionBase
  1086.  
  1087.         bsr.s    SetPrintGads
  1088.         unlk    a5
  1089.         bra    CheckDumpInput
  1090.  
  1091. .PrintWinError    bsr    CloseDumpWin
  1092.         move.l    #MEMORY_ERR,ErrorPrint(a4)
  1093.         bsr    DisplayError
  1094.         unlk    a5
  1095.         moveq    #0,d0
  1096.         rts
  1097.  
  1098.  
  1099.  
  1100. **********************************************************************
  1101. *                 String/Integer Gadget pens setten                  *
  1102. **********************************************************************
  1103. SetStrIntGads    movem.l    RegsAll,-(sp)
  1104.  
  1105. .Loop        move.l    (a0),d0
  1106.         beq.s    .End
  1107.         move.l    (a0)+,a1
  1108.         move.w    gg_GadgetType(a1),d0
  1109.         and.w    #GTYP_STRGADGET,d0
  1110.         beq.s    .NoStrGad
  1111.         move.l    gg_SpecialInfo(a1),a1
  1112.         move.l    si_Extension(a1),a1
  1113.         move.w    #$0102,sex_ActivePens(a1)
  1114. .NoStrGad    bra.s    .Loop
  1115. .End        movem.l    (sp)+,RegsAll
  1116.         rts
  1117.  
  1118.  
  1119.  
  1120.  
  1121. **********************************************************************
  1122. *                      Set print window gadgets                      *
  1123. **********************************************************************
  1124. SetPrintGads    move.l    #GD_GfxAspect,d0        ; Set aspect gadget
  1125.         move.l    GfxAspect(a4),d1
  1126.         bsr    SetPrintCycle
  1127.  
  1128.         move.l    #GD_GfxShade,d0            ; Set shade gadget
  1129.         move.l    GfxShade(a4),d1
  1130.         bsr    SetPrintCycle
  1131.  
  1132.         move.l    #GD_GfxDither,d0
  1133.         move.l    GfxDithering(a4),d1
  1134.         bsr    SetPrintCycle
  1135.  
  1136.         move.l    #GD_GfxScale,d0
  1137.         move.l    GfxScale(a4),d1
  1138.         bsr    SetPrintCycle
  1139.  
  1140.         move.l    #GD_GfxImage,d0
  1141.         move.l    GfxImage(a4),d1
  1142.         bsr    SetPrintCycle
  1143.  
  1144.         move.b    GfxRed(a4),d0            ; Set colors gadgets
  1145.         move.l    #GD_GfxRed,d1
  1146.         bsr    SetPrintBox
  1147.  
  1148.         move.b    GfxGreen(a4),d0
  1149.         move.l    #GD_GfxGreen,d1
  1150.         bsr    SetPrintBox
  1151.  
  1152.         move.b    GfxBlue(a4),d0
  1153.         move.l    #GD_GfxBlue,d1
  1154.         bsr    SetPrintBox
  1155.  
  1156.         move.l    #GD_GfxDensity,d0        ; Set density/threshold
  1157.         move.l    GfxDensity(a4),d1
  1158.         bsr    SetPrintSlid
  1159.  
  1160.         move.l    #GD_GfxThres,d0
  1161.         move.l    GfxThreshold(a4),d1
  1162.         bsr    SetPrintSlid
  1163.  
  1164.         move.l    GfxShade(a4),d1            ; Set shading
  1165.         cmp.l    #3,d1
  1166.         beq.s    .ColorOn
  1167.         moveq    #1,d1
  1168.         bra.s    .SetColors
  1169. .ColorOn    moveq    #0,d1
  1170. .SetColors    move.l    #GD_GfxRed,d0
  1171.         bsr    GhostPrintGad
  1172.         move.l    #GD_GfxGreen,d0
  1173.         bsr    GhostPrintGad
  1174.         move.l    #GD_GfxBlue,d0
  1175.         bsr    GhostPrintGad
  1176.         tst.l    GfxShade(a4)
  1177.         bne.s    .ThresOn
  1178.         moveq    #1,d1
  1179.         bra.s    .MakeThres
  1180. .ThresOn    moveq    #0,d1
  1181. .MakeThres    move.l    #GD_GfxThres,d0
  1182.         bsr    GhostPrintGad
  1183.  
  1184.         move.l    #GD_GfxSize1,d0            ; Set out width/height
  1185.         move.l    GfxOutWidth(a4),d1
  1186.         bsr    SetPrintInt
  1187.  
  1188.         move.l    #GD_GfxSize2,d0
  1189.         move.l    GfxOutHeight(a4),d1
  1190.         bsr    SetPrintInt
  1191.  
  1192.         cmp.l    #4,GfxScale(a4)
  1193.         bne.s    .NoFull
  1194.         moveq    #1,d1
  1195.         move.l    #GD_GfxSize1,d0
  1196.         bsr    GhostPrintGad
  1197.         move.l    #GD_GfxSize2,d0
  1198.         bsr    GhostPrintGad
  1199.  
  1200. .NoFull        move.b    GfxCenter(a4),d0        ; Set checkboxes
  1201.         move.l    #GD_GfxCenter,d1
  1202.         bsr    SetPrintBox
  1203.  
  1204.         move.b    GfxSmooth(a4),d0
  1205.         move.l    #GD_GfxSmooth,d1
  1206.         bsr    SetPrintBox
  1207.  
  1208.         move.b    GfxFormFeed(a4),d0
  1209.         move.l    #GD_GfxFormFeed,d1
  1210.         bsr    SetPrintBox
  1211.  
  1212.         move.b    GfxKeepAspect(a4),d0
  1213.         move.l    #GD_GfxKeepAspect,d1
  1214.         bsr    SetPrintBox
  1215.  
  1216.         move.l    #GD_GfxGfxType,d0        ; Set area and source gadgets
  1217.         move.l    GfxComplete(a4),d1
  1218.         bsr    SetPrintCycle
  1219.  
  1220.         move.l    #GD_GfxDumpType,d0        ; Set type of output
  1221.         move.l    GfxDumpType(a4),d1
  1222.         bsr.s    SetPrintCycle
  1223.  
  1224.         bsr    SetPrintArea
  1225.  
  1226.         move.l    GfxComplete(a4),d1
  1227.         bchg    #0,d1
  1228.         move.l    #GD_GfxX,d0
  1229.         bsr    GhostPrintGad
  1230.         move.l    #GD_GfxY,d0
  1231.         bsr    GhostPrintGad
  1232.         move.l    #GD_GfxWidth,d0
  1233.         bsr.s    GhostPrintGad
  1234.         move.l    #GD_GfxHeight,d0
  1235.         bsr.s    GhostPrintGad
  1236.         move.l    #GD_GfxBounds,d0
  1237.         bsr.s    GhostPrintGad
  1238.  
  1239.         move.l    #GD_GfxSource,d0
  1240.         move.l    GfxSource(a4),d1
  1241.         bsr.s    SetPrintCycle
  1242.  
  1243.         cmp.l    #2,GfxDithering(a4)
  1244.         beq.s    .SmoothOff
  1245.         moveq    #0,d1
  1246.         bra.s    .SetSmooth
  1247. .SmoothOff    moveq    #1,d1
  1248. .SetSmooth    move.l    #GD_GfxSmooth,d0
  1249.         bsr.s    GhostPrintGad
  1250.  
  1251.         move.l    #GD_GfxSourceName,d0
  1252.         tst.l    GfxSource(a4)
  1253.         beq.s    .ShowScreen
  1254.         lea    GfxSourceWin(a4),a2
  1255.         bra.s    .ShowSource
  1256. .ShowScreen    lea    GfxSourceScr(a4),a2
  1257. .ShowSource    RELLIB    SetTextGad,_KCXBase
  1258.         rts
  1259. SetPrintCycle    lea    PrintGads(a4),a0
  1260.         move.l    PrintHandle(a4),a1
  1261.         RELLIB    SetCycleGad,_KCXBase
  1262.         rts
  1263. SetPrintBox    lea    PrintGads(a4),a0
  1264.         move.l    PrintHandle(a4),a1
  1265.         RELLIB    SetCheckBox,_KCXBase
  1266.         rts
  1267. GhostPrintGad    lea    PrintGads(a4),a0
  1268.         move.l    PrintHandle(a4),a1
  1269.         RELLIB    GhostGadget,_KCXBase
  1270.         rts
  1271. SetPrintInt    lea    PrintGads(a4),a0
  1272.         move.l    PrintHandle(a4),a1
  1273.         RELLIB    SetIntegerGad,_KCXBase
  1274.         rts
  1275. SetPrintSlid    lea    PrintGads(a4),a0
  1276.         move.l    PrintHandle(a4),a1
  1277.         RELLIB    SetSliderGad,_KCXBase
  1278.         rts
  1279. **********************************************************************
  1280. *              Sets all four gadgets for area printing               *
  1281. **********************************************************************
  1282. SetPrintArea    move.l    #GD_GfxX,d0            ; Set area integers
  1283.         move.l    GfxLeft(a4),d1
  1284.         bsr    SetPrintInt
  1285.  
  1286.         move.l    #GD_GfxY,d0
  1287.         move.l    GfxTop(a4),d1
  1288.         bsr    SetPrintInt
  1289.  
  1290.         move.l    #GD_GfxWidth,d0
  1291.         move.l    GfxWidth(a4),d1
  1292.         bsr    SetPrintInt
  1293.  
  1294.         move.l    #GD_GfxHeight,d0
  1295.         move.l    GfxHeight(a4),d1
  1296.         bsr    SetPrintInt
  1297.         rts
  1298.  
  1299.  
  1300. **********************************************************************
  1301. *                         Close Print window                         *
  1302. **********************************************************************
  1303. CloseDumpWin    lea    PrintHandle(a4),a3
  1304.         tst.l    (a3)
  1305.         beq.s    .NoWindow
  1306.         move.l    (a3),a0
  1307.         RELLIB    CloseWindow,_IntuitionBase    ; Close Window
  1308. .NoWindow    tst.l    4(a3)
  1309.         beq.s    .NoGadgets
  1310.         move.l    4(a3),a0            ; Free GadTools-Gadgets
  1311.         RELLIB    FreeGadgets,_GadToolsBase
  1312. .NoGadgets    tst.l    8(a3)                ; Free Visual-Info
  1313.         beq.s    .NoVisInfo
  1314.         move.l    8(a3),a0
  1315.         RELLIB    FreeVisualInfo,_GadToolsBase
  1316. .NoVisInfo    clr.l    (a3)                ; Clear flags for later
  1317.         clr.l    4(a3)                ; identification
  1318.         clr.l    8(a3)
  1319.         tst.l    PrintScreen(a4)
  1320.         beq.s    .NoScreen
  1321.         move.l    PrintScreen(a4),a0
  1322.         RELLIB    CloseScreen,_IntuitionBase
  1323. .NoScreen    clr.l    PrintScreen(a4)
  1324.         tst.l    PrintFont
  1325.         beq.s    .NoFont
  1326.         move.l    PrintFont(pc),a1
  1327.         RELLIB    CloseFont,_GfxBase
  1328. .NoFont        rts
  1329.  
  1330.  
  1331. **********************************************************************
  1332. *                     Handle print window input                      *
  1333. **********************************************************************
  1334. CheckDumpInput    move.l    PrintHandle(a4),a0
  1335.         move.l    wd_UserPort(a0),a0
  1336.         CALLSYS    WaitPort
  1337. LoopPrintMsg    move.l    PrintHandle(a4),a0
  1338.         move.l    wd_UserPort(a0),a0
  1339.         RELLIB    GT_GetIMsg,_GadToolsBase
  1340.         tst.l    d0
  1341.         beq    CheckDumpInput
  1342.  
  1343.         move.l    d0,a1
  1344.         move.l    im_Class(a1),d6            ; Get class
  1345.         moveq    #0,d5
  1346.         move.w    im_Code(a1),d5            ; Get code
  1347.         cmp.l    #IDCMP_VANILLAKEY,d6
  1348.         bne.s    .End
  1349.         move.w    im_Qualifier(a1),d4
  1350.         move.l    d5,d0
  1351.         bsr    GetUpperCase
  1352.         move.l    d0,d5
  1353. .End        move.l    d6,d0
  1354.         and.l    #(IDCMP_GADGETUP|IDCMP_GADGETDOWN),d0
  1355.         beq.s    .NoGad
  1356.         moveq    #0,d7
  1357.         move.l    im_IAddress(a1),a2        ; Get gadget id
  1358.         move.w    gg_GadgetID(a2),d7
  1359.  
  1360. .NoGad        DOLIB    GT_ReplyIMsg            ; Reply gadtools msg
  1361.  
  1362.         cmp.l    #IDCMP_CLOSEWINDOW,d6        ; Close Window ?
  1363.         beq    CancelPrint
  1364.  
  1365.         cmp.l    #IDCMP_CHANGEWINDOW,d6        ; Changed window position ?
  1366.         bne.s    NoPrintMove
  1367.         move.l    PrintHandle(a4),a0
  1368.         lea    PrintWinLeft(a4),a1
  1369.         move.w    wd_LeftEdge(a0),0(a1)
  1370.         move.w    wd_TopEdge(a0),2(a1)
  1371.         bra    LoopPrintMsg
  1372.  
  1373. NoPrintMove    cmp.l    #IDCMP_VANILLAKEY,d6
  1374.         bne.s    NoVKey
  1375.         cmp.w    #ESCKEY,d5
  1376.         beq    CancelPrint
  1377.         lea    PrintGads(a4),a3
  1378.         moveq    #0,d1
  1379. .FindGad    move.l    (a3),d0
  1380.         beq    LoopPrintMsg
  1381.         move.l    d0,a0
  1382.         move.l    gg_UserData(a0),d0
  1383.         cmp.b    d0,d5
  1384.         bne.s    .NextGad
  1385.         move.l    #IDCMP_GADGETUP,d6
  1386.         moveq    #-1,d5
  1387.         move.l    d1,d7
  1388.         bra.s    NoVKey
  1389. .NextGad    addq.l    #4,a3
  1390.         addq.l    #1,d1
  1391.         bra.s    .FindGad
  1392.  
  1393. NoVKey        cmp.l    #IDCMP_GADGETUP,d6        ; Gadget picked ?
  1394.         bne    NoPrintGadUp
  1395.  
  1396.         cmp.w    #GD_GfxAspect,d7        ; Aspect ?
  1397.         bne.s    NoAspectGad
  1398.         move.l    GfxAspect(a4),d1
  1399.         bchg    #0,d1
  1400.         move.l    d1,GfxAspect(a4)
  1401.         move.l    #GD_GfxAspect,d0
  1402.         bsr    SetPrintCycle
  1403.         bra    LoopPrintMsg
  1404.  
  1405. NoAspectGad    cmp.w    #GD_GfxShade,d7            ; New Shade ?
  1406.         bne.s    NoShadeGad
  1407.         tst.l    d5
  1408.         bge.s    .DoKey
  1409.         move.l    GfxShade(a4),d5
  1410.         and.w    #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d4
  1411.         beq.s    .Up
  1412.         subq.l    #1,d5
  1413.         bge.s    .GoOnKey
  1414.         moveq    #3,d5
  1415.         bra.s    .GoOnKey
  1416. .Up        addq.l    #1,d5
  1417.         cmp.l    #3,d5
  1418.         ble.s    .GoOnKey
  1419.         moveq    #0,d5
  1420. .GoOnKey    move.l    #GD_GfxShade,d0
  1421.         move.l    d5,d1
  1422.         bsr    SetPrintCycle
  1423. .DoKey        ext.l    d5
  1424.         move.l    d5,GfxShade(a4)
  1425.         cmp.l    #3,d5
  1426.         beq.s    .ColorsOn
  1427.         moveq    #1,d1
  1428.         bra.s    .GoOn
  1429. .ColorsOn    moveq    #0,d1
  1430. .GoOn        move.l    #GD_GfxRed,d0
  1431.         bsr    GhostPrintGad
  1432.         move.l    #GD_GfxGreen,d0
  1433.         bsr    GhostPrintGad
  1434.         move.l    #GD_GfxBlue,d0
  1435.         bsr    GhostPrintGad
  1436.         tst.l    GfxShade(a4)
  1437.         bne.s    .ThresOn
  1438.         moveq    #1,d1
  1439.         bra.s    .MakeThres
  1440. .ThresOn    moveq    #0,d1
  1441. .MakeThres    move.l    #GD_GfxThres,d0
  1442.         bsr    GhostPrintGad
  1443.         bra    LoopPrintMsg
  1444.  
  1445. NoShadeGad    cmp.w    #GD_GfxDither,d7        ; New dither ?
  1446.         bne.s    NoDitherGad
  1447.         tst.l    d5
  1448.         bge.s    .DoKey
  1449.         move.l    GfxDithering(a4),d5
  1450.         and.w    #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d4
  1451.         beq.s    .Up
  1452.         subq.l    #1,d5
  1453.         ble.s    .GoOnKey
  1454.         moveq    #2,d5
  1455.         bra.s    .GoOnKey
  1456. .Up        addq.l    #1,d5
  1457.         cmp.l    #2,d5
  1458.         ble.s    .GoOnKey
  1459.         moveq    #0,d5
  1460. .GoOnKey    move.l    #GD_GfxDither,d0
  1461.         move.l    d5,d1
  1462.         bsr    SetPrintCycle
  1463. .DoKey        ext.l    d5
  1464.         move.l    d5,GfxDithering(a4)
  1465.         cmp.l    #2,d5
  1466.         beq.s    .SmoothOff
  1467.         moveq    #0,d1
  1468.         bra.s    .GoOn
  1469. .SmoothOff    moveq    #1,d1
  1470. .GoOn        move.l    #GD_GfxSmooth,d0
  1471.         bsr    GhostPrintGad
  1472.         bra    LoopPrintMsg
  1473.  
  1474. NoDitherGad    cmp.w    #GD_GfxImage,d7            ; Change image type ?
  1475.         bne.s    NoImageGad
  1476.         move.l    GfxImage(a4),d1
  1477.         bchg    #0,d1
  1478.         move.l    d1,GfxImage(a4)
  1479.         move.l    #GD_GfxImage,d0
  1480.         bsr    SetPrintCycle
  1481.         bra    LoopPrintMsg
  1482.  
  1483. NoImageGad    cmp.w    #GD_GfxDensity,d7        ; Changed density ?
  1484.         bne.s    NoDensityGad
  1485.         tst.l    d5
  1486.         bge.s    .DoKey
  1487.         move.l    GfxDensity(a4),d1
  1488.         and.w    #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d4
  1489.         beq.s    .Up
  1490.         subq.l    #1,d1
  1491.         bgt.s    .GoOn
  1492.         move.l    #7,d1
  1493.         bra.s    .GoOn
  1494. .Up        addq.l    #1,d1
  1495.         cmp.l    #7,d1
  1496.         ble.s    .GoOn
  1497.         moveq    #1,d1
  1498. .GoOn        move.l    d1,GfxDensity(a4)
  1499.         move.l    #GD_GfxDensity,d0
  1500.         bsr    SetPrintSlid
  1501.         bra    LoopPrintMsg
  1502. .DoKey        ext.l    d5
  1503.         move.l    d5,GfxDensity(a4)
  1504.         bra    LoopPrintMsg
  1505.  
  1506. NoDensityGad    cmp.w    #GD_GfxRed,d7            ; Changed red colors ?
  1507.         bne.s    NoRedGad
  1508.         cmp.l    #3,GfxShade(a4)
  1509.         bne    LoopPrintMsg
  1510.         bchg    #0,GfxRed(a4)
  1511.         move.b    GfxRed(a4),d0
  1512.         move.l    #GD_GfxRed,d1
  1513.         bsr    SetPrintBox
  1514.         bra    LoopPrintMsg
  1515.  
  1516. NoRedGad    cmp.w    #GD_GfxGreen,d7            ; Changed green colors ?
  1517.         bne.s    NoGreenGad
  1518.         cmp.l    #3,GfxShade(a4)
  1519.         bne    LoopPrintMsg
  1520.         bchg    #0,GfxGreen(a4)
  1521.         move.b    GfxGreen(a4),d0
  1522.         move.l    #GD_GfxGreen,d1
  1523.         bsr    SetPrintBox
  1524.         bra    LoopPrintMsg
  1525.  
  1526. NoGreenGad    cmp.w    #GD_GfxBlue,d7            ; Changed blue colors ?
  1527.         bne.s    NoBlueGad
  1528.         cmp.l    #3,GfxShade(a4)
  1529.         bne    LoopPrintMsg
  1530.         bchg    #0,GfxBlue(a4)
  1531.         move.b    GfxBlue(a4),d0
  1532.         move.l    #GD_GfxBlue,d1
  1533.         bsr    SetPrintBox
  1534.         bra    LoopPrintMsg
  1535.  
  1536. NoBlueGad    cmp.w    #GD_GfxScale,d7            ; Changed scale ?
  1537.         bne.s    NoScaleGad
  1538.         tst.l    d5
  1539.         bge.s    .DoKey
  1540.         move.l    GfxScale(a4),d1
  1541.         and.w    #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d4
  1542.         beq.s    .Up
  1543.         subq.l    #1,d1
  1544.         bge.s    .GoOn
  1545.         moveq    #4,d1
  1546.         bra.s    .GoOn
  1547. .Up        addq.l    #1,d1
  1548.         cmp.l    #4,d1
  1549.         ble.s    .GoOn
  1550.         moveq    #0,d1
  1551. .GoOn        move.l    d1,GfxScale(a4)
  1552.         move.l    #GD_GfxScale,d0
  1553.         bsr    SetPrintCycle
  1554.         move.l    d1,d5
  1555. .DoKey        ext.l    d5
  1556.         move.l    d5,GfxScale(a4)
  1557.         moveq    #0,d1
  1558.         cmp.l    #4,d5
  1559.         bne.s    .NoFull
  1560.         moveq    #1,d1
  1561. .NoFull        move.l    #GD_GfxSize1,d0
  1562.         bsr    GhostPrintGad
  1563.         move.l    #GD_GfxSize2,d0
  1564.         bsr    GhostPrintGad
  1565.         bra    LoopPrintMsg
  1566.  
  1567. NoScaleGad    cmp.w    #GD_GfxSize1,d7            ; Changed size1 ?
  1568.         bne.s    NoSize1Gad
  1569.         tst.l    d5
  1570.         bge.s    DoSize1Key
  1571.         cmp.l    #4,GfxScale(a4)
  1572.         beq    LoopPrintMsg
  1573.         move.l    #GD_GfxSize1,d0
  1574. ActPrintGad    lea    PrintGads(a4),a0
  1575.         move.l    PrintHandle(a4),a1
  1576.         RELLIB    ActStringGad,_KCXBase
  1577.         bra    LoopPrintMsg
  1578. DoSize1Key    lea    GfxOutWidth(a4),a1
  1579. CheckPrintInt    move.l    gg_SpecialInfo(a2),a0
  1580.         move.l    si_LongInt(a0),d0
  1581.         move.l    d0,(a1)
  1582.         tst.l    d0
  1583.         bge.s    .GoOn
  1584.         clr.l    (a1)
  1585.         move.w    d7,d0
  1586.         moveq    #0,d1
  1587.         lea    PrintGads(a4),a0
  1588.         move.l    PrintHandle(a4),a1
  1589.         RELLIB    SetIntegerGad,_KCXBase
  1590.         sub.l    a0,a0
  1591.         RELLIB    DisplayBeep,_IntuitionBase
  1592. .GoOn        bra    LoopPrintMsg
  1593.  
  1594. NoSize1Gad    cmp.w    #GD_GfxSize2,d7            ; Changed size2 ?
  1595.         bne.s    NoSize2Gad
  1596.         lea    GfxOutHeight(a4),a1
  1597.         bra    CheckPrintInt
  1598.  
  1599. NoSize2Gad    cmp.w    #GD_GfxThres,d7            ; New threshold ?
  1600.         bne.s    NoThresGad
  1601.         tst.l    d5
  1602.         bge.s    .DoKey
  1603.         move.l    GfxThreshold(a4),d1
  1604.         and.w    #IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT,d4
  1605.         beq.s    .Up
  1606.         subq.l    #1,d1
  1607.         bgt.s    .GoOn
  1608.         move.l    #15,d1
  1609.         bra.s    .GoOn
  1610. .Up        addq.l    #1,d1
  1611.         cmp.l    #15,d1
  1612.         ble.s    .GoOn
  1613.         moveq    #1,d1
  1614. .GoOn        move.l    d1,GfxThreshold(a4)
  1615.         move.l    #GD_GfxThres,d0
  1616.         bsr    SetPrintSlid
  1617.         bra    LoopPrintMsg
  1618. .DoKey        ext.l    d5
  1619.         move.l    d5,GfxThreshold(a4)
  1620.         bra    LoopPrintMsg
  1621.  
  1622. NoThresGad    cmp.w    #GD_GfxCenter,d7        ; Changed center ?
  1623.         bne.s    NoCenterGad
  1624.         bchg    #0,GfxCenter(a4)
  1625.         move.b    GfxCenter(a4),d0
  1626.         move.l    #GD_GfxCenter,d1
  1627.         bsr    SetPrintBox
  1628.         bra    LoopPrintMsg
  1629.  
  1630. NoCenterGad    cmp.w    #GD_GfxSmooth,d7        ; Changed smooth ?
  1631.         bne.s    NoSmoothGad
  1632.         cmp.l    #2,GfxDithering(a4)
  1633.         beq    LoopPrintMsg
  1634.         bchg    #0,GfxSmooth(a4)
  1635.         move.b    GfxSmooth(a4),d0
  1636.         move.l    #GD_GfxSmooth,d1
  1637.         bsr    SetPrintBox
  1638.         bra    LoopPrintMsg
  1639.  
  1640. NoSmoothGad    cmp.w    #GD_GfxFormFeed,d7        ; Changed formfeed gad ?
  1641.         bne.s    NoFFeedGad
  1642.         bchg    #0,GfxFormFeed(a4)
  1643.         move.b    GfxFormFeed(a4),d0
  1644.         move.l    #GD_GfxFormFeed,d1
  1645.         bsr    SetPrintBox
  1646.         bra    LoopPrintMsg
  1647.  
  1648. NoFFeedGad    cmp.w    #GD_GfxKeepAspect,d7        ; Changed aspect ?
  1649.         bne.s    NoKAspectGad
  1650.         bchg    #0,GfxKeepAspect(a4)
  1651.         move.b    GfxKeepAspect(a4),d0
  1652.         move.l    #GD_GfxKeepAspect,d1
  1653.         bsr    SetPrintBox
  1654.         bra    LoopPrintMsg
  1655.  
  1656. NoKAspectGad    cmp.w    #GD_GfxGfxType,d7        ; Changed Gfx type ?
  1657.         bne.s    NoGfxTypeGad
  1658.         move.l    GfxComplete(a4),d1
  1659.         bchg    #0,d1
  1660.         move.l    d1,GfxComplete(a4)
  1661.         move.l    #GD_GfxGfxType,d0
  1662.         bsr    SetPrintCycle
  1663.         bchg    #0,d1
  1664.         move.l    #GD_GfxX,d0
  1665.         bsr    GhostPrintGad
  1666.         move.l    #GD_GfxY,d0
  1667.         bsr    GhostPrintGad
  1668.         move.l    #GD_GfxWidth,d0
  1669.         bsr    GhostPrintGad
  1670.         move.l    #GD_GfxHeight,d0
  1671.         bsr    GhostPrintGad
  1672.         move.l    #GD_GfxBounds,d0
  1673.         bsr    GhostPrintGad
  1674.         bra    LoopPrintMsg
  1675.  
  1676. NoGfxTypeGad    cmp.w    #GD_GfxX,d7            ; Changed left ?
  1677.         bne.s    NoGfxLeftGad
  1678.         tst.l    d5
  1679.         bge.s    .NoKey
  1680.         tst.l    GfxComplete(a4)
  1681.         beq    LoopPrintMsg
  1682.         move.l    #GD_GfxX,d0
  1683.         bra    ActPrintGad
  1684. .NoKey        lea    GfxLeft(a4),a1
  1685.         bra    CheckPrintInt
  1686.  
  1687. NoGfxLeftGad    cmp.w    #GD_GfxY,d7            ; Changed top ?
  1688.         bne.s    NoGfxTopEdge
  1689.         tst.l    d5
  1690.         bge.s    .NoKey
  1691.         tst.l    GfxComplete(a4)
  1692.         beq    LoopPrintMsg
  1693.         move.l    #GD_GfxY,d0
  1694.         bra    ActPrintGad
  1695. .NoKey        lea    GfxTop(a4),a1
  1696.         bra    CheckPrintInt
  1697.  
  1698. NoGfxTopEdge    cmp.w    #GD_GfxWidth,d7            ; Changed width ?
  1699.         bne.s    NoGfxWidthGad
  1700.         tst.l    d5
  1701.         bge.s    .NoKey
  1702.         tst.l    GfxComplete(a4)
  1703.         beq    LoopPrintMsg
  1704.         move.l    #GD_GfxWidth,d0
  1705.         bra    ActPrintGad
  1706. .NoKey        lea    GfxWidth(a4),a1
  1707.         bra    CheckPrintInt
  1708.  
  1709. NoGfxWidthGad    cmp.w    #GD_GfxHeight,d7        ; Changed height ?
  1710.         bne.s    NoGfxHeightGad
  1711.         tst.l    d5
  1712.         bge.s    .NoKey
  1713.         tst.l    GfxComplete(a4)
  1714.         beq    LoopPrintMsg
  1715.         move.l    #GD_GfxHeight,d0
  1716.         bra    ActPrintGad
  1717. .NoKey        lea    GfxHeight(a4),a1
  1718.         bra    CheckPrintInt
  1719.  
  1720. NoGfxHeightGad    cmp.w    #GD_GfxSource,d7        ; Changed source ?
  1721.         bne.s    NoGfxSourceGad
  1722.         move.l    GfxSource(a4),d5
  1723.         bchg    #0,d5
  1724.         move.l    d5,GfxSource(a4)
  1725.         move.l    #GD_GfxSource,d0
  1726.         move.l    d5,d1
  1727.         bsr    SetPrintCycle
  1728. GfxSourceKey    tst.l    d5
  1729.         beq.s    .ShowScreen
  1730.         lea    GfxSourceWin(a4),a2
  1731.         bra.s    .SetSource
  1732. .ShowScreen    lea    GfxSourceScr(a4),a2
  1733. .SetSource    move.l    #GD_GfxSourceName,d0
  1734.         lea    PrintGads(a4),a0
  1735.         move.l    PrintHandle(a4),a1
  1736.         RELLIB    SetTextGad,_KCXBase
  1737.         bra    LoopPrintMsg
  1738.  
  1739. NoGfxSourceGad    cmp.w    #GD_GfxGet,d7            ; Get new window/screen ?
  1740.         bne    NoGfxGetGad
  1741.         tst.l    d5
  1742.         bge.s    .NoKey
  1743.         move.l    #GD_GfxGet,d0
  1744.         lea    PrintGads(a4),a0
  1745.         move.l    PrintHandle(a4),a5
  1746.         bsr    ButtonCheck
  1747. .NoKey        move.l    PrintHandle(a4),a0
  1748.         LOCLEA    GfxGetTitle,a1
  1749.         LOCLEA    WindowScrTitle,a2
  1750.         RELLIB    SetWindowTitles,_IntuitionBase
  1751.         ST    GetSource(a4)
  1752.         move.l    #SIGLBUTTON,d0
  1753.         CALLSYS    Wait
  1754.         SF    GetSource(a4)
  1755.         bsr    GetNewSource
  1756.         move.l    PrintHandle(a4),a0
  1757.         lea    PrintTitle(a4),a1
  1758.         LOCLEA    WindowScrTitle,a2
  1759.         RELLIB    SetWindowTitles,_IntuitionBase
  1760.         move.l    PrintHandle(a4),a0
  1761.         DOLIB    WindowToFront
  1762.         move.l    PrintHandle(a4),a0
  1763.         move.l    wd_WScreen(a0),a0
  1764.         DOLIB    ScreenToFront
  1765.         move.l    GfxSource(a4),d5
  1766.         bra    GfxSourceKey
  1767.  
  1768. NoGfxGetGad    cmp.w    #GD_GfxBounds,d7        ; Get new bounds for gfx ?
  1769.         bne.s    NoGfxBoundGad
  1770.         tst.l    d5
  1771.         bge.s    .NoKey
  1772.         tst.l    GfxComplete(a4)
  1773.         beq    LoopPrintMsg
  1774.         move.l    #GD_GfxBounds,d0
  1775.         lea    PrintGads(a4),a0
  1776.         move.l    PrintHandle(a4),a5
  1777.         bsr    ButtonCheck
  1778. .NoKey        bsr    GetNewBounds
  1779.         bra    LoopPrintMsg
  1780.  
  1781. NoGfxBoundGad    cmp.w    #GD_GfxPrint,d7            ; Print ?
  1782.         bne.s    NoPrintGad
  1783.         tst.l    d5
  1784.         bge.s    .NoKey
  1785.         move.l    #GD_GfxPrint,d0
  1786.         lea    PrintGads(a4),a0
  1787.         move.l    PrintHandle(a4),a5
  1788.         bsr    ButtonCheck
  1789. .NoKey        tst.l    GfxDumpType(a4)
  1790.         bne.s    .NoDims
  1791.         bsr    CheckPrintDim
  1792.         tst.l    d0
  1793.         beq    LoopPrintMsg
  1794.         bra.s    .GoOn
  1795. .NoDims        clr.l    -(sp)
  1796.         pea    FRF_DOSAVEMODE
  1797.         clr.l    -(sp)
  1798.         clr.w    -(sp)
  1799.         lea    PrintFileName(pc),a0
  1800.         move.l    a0,-(sp)
  1801.         pea    PrintDumpHeader
  1802.         move.l    PrintHandle(a4),-(sp)
  1803.         bsr    GetFileName
  1804.         lea    26(sp),sp
  1805.         bra.s    EndInput
  1806. .GoOn        moveq    #1,d0
  1807.         bra.s    EndInput
  1808.  
  1809. NoPrintGad    cmp.w    #GD_GfxCancel,d7        ; Cancel ?
  1810.         bne.s    NoPrintCancel
  1811.         tst.l    d5
  1812.         bge.s    .NoKey
  1813.         move.l    #GD_GfxCancel,d0
  1814.         lea    PrintGads(a4),a0
  1815.         move.l    PrintHandle(a4),a5
  1816.         bsr    ButtonCheck
  1817. .NoKey
  1818. CancelPrint    moveq    #0,d0
  1819.         bra.s    EndInput
  1820.  
  1821. NoPrintCancel    cmp.w    #GD_GfxDumpType,d7        ; New dump type ?
  1822.         bne.s    NoDumpType
  1823.         move.l    GfxDumpType(a4),d1
  1824.         bchg    #0,d1
  1825.         move.l    d1,GfxDumpType(a4)
  1826.         move.l    #GD_GfxDumpType,d0
  1827.         bsr    SetPrintCycle
  1828.         bra    LoopPrintMsg
  1829. NoDumpType
  1830. NoPrintGadUp    bra    LoopPrintMsg
  1831. EndInput    rts
  1832.  
  1833.  
  1834.  
  1835. **********************************************************************
  1836. *                           Get new inputs                           *
  1837. **********************************************************************
  1838. GetNewSource    clr.l    GfxWindow(a4)            ; Get current screen and window
  1839.         clr.l    GfxScreen(a4)
  1840.         clr.b    GfxSourceScr(a4)
  1841.         clr.b    GfxSourceWin(a4)
  1842.         RELLIB    FindWindow,_KCXBase
  1843.         move.l    a0,a2
  1844.         tst.l    d0
  1845.         beq.s    .NoLayer
  1846.         move.l    d0,a0
  1847.         move.l    lr_Window(a0),d0
  1848.         beq.s    .NoLayer
  1849.         move.l    d0,a0
  1850.         move.l    a0,GfxWindow(a4)
  1851.         move.l    wd_Title(a0),d0
  1852.         beq.s    .NoLayer
  1853.         move.l    d0,a0
  1854.         lea    GfxSourceWin(a4),a1
  1855.         bsr    StrCpy
  1856. .NoLayer    move.l    a2,d0
  1857.         beq.s    .NoScreen
  1858.         move.l    a2,GfxScreen(a4)
  1859.         move.l    sc_Title(a2),d0
  1860.         beq.s    .NoScreen
  1861.         move.l    d0,a0
  1862.         lea    GfxSourceScr(a4),a1
  1863.         bsr    StrCpy
  1864. .NoScreen    rts
  1865.  
  1866.  
  1867.  
  1868. **********************************************************************
  1869. *                  Get new boundaries for printout                   *
  1870. **********************************************************************
  1871. GetNewBounds    tst.l    GfxSource(a4)
  1872.         beq.s    .FromScreen
  1873.         move.l    GfxWindow(a4),a0
  1874.         move.l    wd_RPort(a0),GfxRastPort(a4)
  1875.         move.l    wd_WScreen(a0),GfxBoundScr(a4)
  1876.         moveq    #0,d0
  1877.         move.w    wd_LeftEdge(a0),d0
  1878.         move.l    d0,GfxLeft(a4)
  1879.         move.w    wd_TopEdge(a0),d0
  1880.         move.l    d0,GfxTop(a4)
  1881.         move.w    wd_Width(a0),d0
  1882.         subq.l    #1,d0
  1883.         move.l    d0,GfxWidth(a4)
  1884.         move.w    wd_Height(a0),d0
  1885.         subq.l    #1,d0
  1886.         move.l    d0,GfxHeight(a4)
  1887.         move.l    GfxWindow(a4),a0
  1888.         RELLIB    WindowToFront,_IntuitionBase
  1889.         move.l    GfxBoundScr(a4),a0
  1890.         DOLIB    ScreenToFront
  1891.         bra.s    .GetBounds
  1892. .FromScreen    move.l    GfxScreen(a4),a0
  1893.         lea    sc_RastPort(a0),a1
  1894.         move.l    a1,GfxRastPort(a4)
  1895.         move.l    a0,GfxBoundScr(a4)
  1896.         moveq    #0,d0
  1897.         move.l    d0,GfxLeft(a4)
  1898.         move.l    d0,GfxTop(a4)
  1899.         move.w    sc_Width(a0),d0
  1900.         subq.l    #1,d0
  1901.         move.l    d0,GfxWidth(a4)
  1902.         move.w    sc_Height(a0),d0
  1903.         subq.l    #1,d0
  1904.         move.l    d0,GfxHeight(a4)
  1905.         move.l    GfxScreen(a4),a0
  1906.         RELLIB    ScreenToFront,_IntuitionBase
  1907.  
  1908. .GetBounds    move.l    GfxRastPort(a4),a1
  1909.         moveq    #0,d0
  1910.         move.b    rp_DrawMode(a1),d0
  1911.         move.w    d0,GfxDrawMode(a4)
  1912.         move.l    #RP_COMPLEMENT,d0
  1913.         RELLIB    SetDrMd,_GfxBase
  1914.  
  1915.         clr.l    GfxRX(a4)
  1916.         clr.l    GfxRY(a4)
  1917.         clr.l    GfxRX2(a4)
  1918.         clr.l    GfxRY2(a4)
  1919.         bsr    DrawBoundRec
  1920.  
  1921.         move.b    #1,GfxGetting(a4)        ; Set flag for Handler
  1922.  
  1923. .DrawLoop    move.l    #SIGMOUSE|SIGLBUTTON|SIGRBUTTON,d0
  1924.         CALLSYS    Wait                ; Wait for signals
  1925.         move.l    d0,d1                ; Right button pressed ?
  1926.         and.l    #SIGRBUTTON,d1            ; Quit drawing
  1927.         bne    .EndDraw
  1928.         move.l    d0,d1                ; Left button ?
  1929.         and.l    #SIGLBUTTON,d1
  1930.         bne.s    .NewPos
  1931.         and.l    #SIGMOUSE,d0            ; Mouse just moved ?
  1932.         bne.s    .NoNewPos
  1933.         bra.s    .DrawLoop
  1934. .NewPos        bsr    DrawBoundRec            ; Get new position
  1935.         move.l    GfxBoundScr(a4),a1
  1936.         bsr    GetCoords
  1937.         sub.l    GfxLeft(a4),d2
  1938.         sub.l    GfxTop(a4),d3
  1939.         move.l    d2,d4
  1940.         move.l    d3,d5
  1941.         bsr    TestBounds            ; Check boundaries
  1942.         move.l    d4,GfxRX(a4)
  1943.         move.l    d5,GfxRY(a4)
  1944.         addq.l    #1,d4
  1945.         addq.l    #1,d5
  1946.         move.l    d4,GfxRX2(a4)
  1947.         move.l    d5,GfxRY2(a4)
  1948.         bsr    DrawBoundRec            ; Draw new rec
  1949.         bra.s    .DrawLoop
  1950. .NoNewPos    move.l    GfxBoundScr(a4),a1        ; Mouse really moved ?
  1951.         bsr    GetCoords
  1952.         sub.l    GfxLeft(a4),d2
  1953.         sub.l    GfxTop(a4),d3
  1954.         move.l    d2,d6
  1955.         move.l    d3,d7
  1956.         cmp.l    GfxRX2(a4),d6
  1957.         bne.s    .NewRec
  1958.         cmp.l    GfxRY2(a4),d7
  1959.         beq    .DrawLoop
  1960. .NewRec        bsr    DrawBoundRec            ; Clear old rec
  1961.         move.l    d6,GfxRX2(a4)
  1962.         move.l    d7,GfxRY2(a4)
  1963.         bsr    DrawBoundRec            ; Draw new one
  1964.         bra    .DrawLoop
  1965. .EndDraw    bsr    DrawBoundRec
  1966.         clr.b    GfxGetting(a4)
  1967.  
  1968.         move.l    GfxRX(a4),d4            ; Correct coords the second time
  1969.         move.l    GfxRY(a4),d5
  1970.         bsr    TestBounds
  1971.         move.l    d4,d0
  1972.         move.l    d5,d2
  1973.  
  1974.         move.l    GfxRX2(a4),d4
  1975.         move.l    GfxRY2(a4),d5
  1976.         bsr    TestBounds
  1977.         move.l    d4,d1
  1978.         move.l    d5,d3
  1979.  
  1980.         cmp.l    d0,d1                ; Swap coords if needed
  1981.         bge.s    .X2Big
  1982.         exg    d0,d1
  1983. .X2Big        cmp.l    d2,d3
  1984.         bge.s    .Y2Big
  1985.         exg    d2,d3
  1986. .Y2Big        sub.l    d0,d1
  1987.         sub.l    d2,d3
  1988.  
  1989.         move.l    d0,GfxLeft(a4)            ; Store new coords
  1990.         move.l    d2,GfxTop(a4)
  1991.         move.l    d1,GfxWidth(a4)
  1992.         move.l    d3,GfxHeight(a4)
  1993.  
  1994.         move.l    GfxRastPort(a4),a1
  1995.         move.w    GfxDrawMode(a4),d0
  1996.         RELLIB    SetDrMd,_GfxBase
  1997.  
  1998.         move.l    PrintHandle(a4),a0        ; Get our window back to front
  1999.         RELLIB    WindowToFront,_IntuitionBase
  2000.         move.l    PrintHandle(a4),a0
  2001.         move.l    wd_WScreen(a0),a0
  2002.         DOLIB    ScreenToFront
  2003.         bra    SetPrintArea
  2004.  
  2005.  
  2006.  
  2007. **********************************************************************
  2008. *                      Get correct coordinates                       *
  2009. **********************************************************************
  2010. GetCoords    move.l    a1,-(sp)
  2011.         moveq    #0,d0
  2012.         RELLIB    LockIBase,_IntuitionBase
  2013.         move.l    d0,d5
  2014.         move.l    (sp)+,a1
  2015.         move.l    ib_ActiveScreen(a6),a0
  2016.         moveq    #0,d2
  2017.         moveq    #0,d3
  2018.         move.w    sc_MouseX(a0),d2
  2019.         move.w    sc_MouseY(a0),d3
  2020.         movem.l    RegsAll,-(sp)
  2021.         move.l    d5,a0
  2022.         DOLIB    UnlockIBase
  2023.         movem.l    (sp)+,RegsAll
  2024.         rts
  2025.  
  2026.  
  2027.  
  2028.  
  2029. **********************************************************************
  2030. *             Draw the rec showing the boundaries by the             *
  2031. **********************************************************************
  2032. DrawBoundRec    move.l    GfxRX2(a4),d4
  2033.         move.l    GfxRY2(a4),d5
  2034.         bsr.s    TestBounds
  2035.  
  2036.         move.l    GfxRastPort(a4),a1
  2037.         move.l    GfxRX(a4),d0
  2038.         move.l    GfxRY(a4),d1
  2039.         RELLIB    Move,_GfxBase
  2040.  
  2041.         move.l    GfxRastPort(a4),a1
  2042.         move.l    d4,d0
  2043.         move.l    GfxRY(a4),d1
  2044.         DOLIB    Draw
  2045.  
  2046.         move.l    GfxRastPort(a4),a1
  2047.         move.l    d4,d0
  2048.         move.l    d5,d1
  2049.         DOLIB    Draw
  2050.  
  2051.         move.l    GfxRastPort(a4),a1
  2052.         move.l    GfxRX(a4),d0
  2053.         move.l    d5,d1
  2054.         DOLIB    Draw
  2055.  
  2056.         move.l    GfxRastPort(a4),a1
  2057.         move.l    GfxRX(a4),d0
  2058.         move.l    GfxRY(a4),d1
  2059.         DOLIB    Draw
  2060.         rts
  2061.  
  2062.  
  2063.  
  2064. **********************************************************************
  2065. *                        Test current bounds                         *
  2066. **********************************************************************
  2067. TestBounds    tst.l    d4
  2068.         bge.s    .XBig
  2069.         moveq    #0,d4
  2070. .XBig        cmp.l    GfxWidth(a4),d4
  2071.         ble.s    .CheckY
  2072.         move.l    GfxWidth(a4),d4
  2073. .CheckY        tst.l    d5
  2074.         bge.s    .YBig
  2075.         moveq    #0,d5
  2076. .YBig        cmp.l    GfxHeight(a4),d5
  2077.         ble.s    .DrawRec
  2078.         move.l    GfxHeight(a4),d5
  2079. .DrawRec    rts
  2080.  
  2081.  
  2082.  
  2083.  
  2084. **********************************************************************
  2085. *                       Checks the user input                        *
  2086. **********************************************************************
  2087. CheckPrintDim    cmp.l    #4,GfxScale(a4)
  2088.         beq.s    .NoFrac
  2089.         tst.l    GfxOutWidth(a4)
  2090.         beq.s    .Error
  2091.         tst.l    GfxOutHeight(a4)
  2092.         beq.s    .Error
  2093.         cmp.l    #3,GfxScale(a4)
  2094.         bne.s    .NoFrac
  2095.         cmp.l    #100,GfxOutWidth(a4)
  2096.         bgt.s    .Error
  2097.         cmp.l    #100,GfxOutHeight(a4)
  2098.         bgt.s    .Error
  2099. .NoFrac        tst.l    GfxComplete(a4)
  2100.         beq.s    .End
  2101.         tst.l    GfxWidth(a4)
  2102.         beq.s    .Error
  2103.         tst.l    GfxHeight(a4)
  2104.         beq.s    .Error
  2105. .End        moveq    #1,d0
  2106.         rts
  2107. .Error        move.l    #CHECKDIM_ERR,ErrorPrint(a4)
  2108.         bsr.s    DisplayError
  2109.         moveq    #0,d0
  2110.         rts
  2111.  
  2112.  
  2113.  
  2114.  
  2115. **********************************************************************
  2116. *                           Copy a string                            *
  2117. **********************************************************************
  2118. StrCpy        move.b    (a0)+,d0
  2119.         move.b    d0,(a1)+
  2120.         tst.b    d0
  2121.         beq.s    .End
  2122.         bra.s    StrCpy
  2123. .End        rts
  2124.  
  2125.  
  2126. **********************************************************************
  2127. *                          Concat 2 string                           *
  2128. **********************************************************************
  2129. StrCat        tst.b    (a1)+
  2130.         beq.s    .Loop
  2131.         bra    StrCat
  2132. .Loop        subq.l    #1,a1
  2133.         bra    StrCpy
  2134.  
  2135.  
  2136. **********************************************************************
  2137. *                      Calc length of a string                       *
  2138. **********************************************************************
  2139. StrLen        move.l    a0,-(sp)
  2140.         moveq    #0,d0
  2141. .Loop        tst.b    (a0)+
  2142.         beq.s    .End
  2143.         addq.w    #1,d0
  2144.         bne.s    .Loop
  2145. .End        move.l    (sp)+,a0
  2146.         rts
  2147.  
  2148. **********************************************************************
  2149. *              Stub for calling the library`s EditHook               *
  2150. **********************************************************************
  2151. MyStrEditFunc    movem.l    RegsAll,-(sp)
  2152.         move.l    h_Data(a0),a4
  2153.         RELLIB    StrEditFunc,_KCXBase
  2154.         movem.l    (sp)+,RegsAll
  2155.         rts
  2156.  
  2157.  
  2158.  
  2159.  
  2160. **********************************************************************
  2161. *                          Display an error                          *
  2162. **********************************************************************
  2163. DisplayError    movem.l    RegsAll,-(sp)
  2164.         move.l    ErrorPrint(a4),d0
  2165.         lea    PrintErrArg(a4),a3
  2166.         RELLIB    DisplayError,_KCXBase
  2167.         movem.l    (sp)+,RegsAll
  2168.         rts
  2169.  
  2170.  
  2171.  
  2172.  
  2173. **********************************************************************
  2174. *               Give visual feedback for button press                *
  2175. * D0 = Number of gadget                                              *
  2176. * A0 = Pointer to first gadget                                       *
  2177. * A5 = Pointer to window                                             *
  2178. **********************************************************************
  2179. ButtonCheck    movem.l    RegsAll,-(sp)
  2180.         move.l    a5,d1
  2181.         beq    .End
  2182.         RELLIB    GetGadgetPtr,_KCXBase
  2183.         move.l    a0,a3
  2184.         move.l    a0,a1
  2185.         or.w    #GFLG_SELECTED,gg_Flags(a3)
  2186.         move.l    a3,a0
  2187.         move.l    a5,a1
  2188.         sub.l    a2,a2
  2189.         moveq    #1,d0
  2190.         RELLIB    RefreshGList,_IntuitionBase
  2191.         move.l    wd_IDCMPFlags(a5),d5
  2192.         move.l    a5,a0
  2193.         move.l    #IDCMP_RAWKEY,d0
  2194.         DOLIB    ModifyIDCMP
  2195. .WaitMsg    move.l    wd_UserPort(a5),a0
  2196.         CALLSYS    WaitPort
  2197. .LoopMsgs    move.l    wd_UserPort(a5),a0
  2198.         RELLIB    GT_GetIMsg,_GadToolsBase
  2199.         tst.l    d0
  2200.         beq.s    .WaitMsg
  2201.         move.l    d0,a1
  2202.         move.l    im_Class(a1),d6
  2203.         move.w    im_Code(a1),d7
  2204.         DOLIB    GT_ReplyIMsg
  2205.         cmp.l    #IDCMP_RAWKEY,d6
  2206.         bne.s    .LoopMsgs
  2207.         and.w    #IECODE_UP_PREFIX,d7
  2208.         beq.s    .LoopMsgs
  2209.         move.l    a5,a0
  2210.         move.l    d5,d0
  2211.         RELLIB    ModifyIDCMP,_IntuitionBase
  2212.         and.w    #~GFLG_SELECTED,gg_Flags(a3)
  2213.         move.l    a3,a0
  2214.         move.l    a5,a1
  2215.         sub.l    a2,a2
  2216.         moveq    #1,d0
  2217.         DOLIB    RefreshGList
  2218. .End        movem.l    (sp)+,RegsAll
  2219.         rts
  2220.  
  2221.  
  2222.  
  2223.  
  2224. **********************************************************************
  2225. *                 Get a file name via ASL-Requester                  *
  2226. * Parameters must be passed on stack in given order                  *
  2227. *  1. Pointer to window                                              *
  2228. *  2. Pointer to requester header                                    *
  2229. *  3. Pointer to complete filename                                   *
  2230. *  4. Number of gadget to change                                     *
  2231. *  5. Pointer to GadgetArray                                         *
  2232. *  6. Mode for filerequester                                         *
  2233. *  7. Pointer to Gadgetroutine (Offset)                              *
  2234. **********************************************************************
  2235. GetFileName    CARGS    #64,.Window.l,.Header.l,.CompleteName.l,.GadgetNum.w,.GadgetList.l,.Mode.L,.GadFunc.L
  2236.         movem.l    d1-d7/a0-a6,-(sp)
  2237.         link    a5,#-(ra_SIZEOF)
  2238.         move.l    .Window(a5),a0
  2239.         move.l    wd_WScreen(a0),a0
  2240.         lea    sc_ViewPort(a0),a0
  2241.         RELLIB    GetVPModeID,_GfxBase
  2242.         move.l    d0,a0
  2243.         lea    -(ra_SIZEOF)(a5),a1
  2244.         move.l    #OSCAN_TEXT,d0
  2245.         RELLIB    QueryOverscan,_IntuitionBase
  2246.         lea    -(ra_SIZEOF)(a5),a2
  2247.         moveq    #0,d0
  2248.         move.w    ra_MaxX(a2),d0
  2249.         sub.w    ra_MinX(a2),d0
  2250.         addq.w    #1,d0
  2251.         move.l    #45,d1
  2252.         RELLIB    UMult32,_UtilityBase
  2253.         move.l    #100,d1
  2254.         DOLIB    UDivMod32
  2255.         move.l    d0,d2                ; Width of FileReq
  2256.         moveq    #0,d0
  2257.         move.w    ra_MaxY(a2),d0
  2258.         sub.w    ra_MinY(a2),d0
  2259.         addq.w    #1,d0
  2260.         moveq    #8,d1
  2261.         DOLIB    UMult32
  2262.         moveq    #10,d1
  2263.         DOLIB    UDivMod32
  2264.         move.l    d0,d3                ; Height of FileReq
  2265.         move.l    d2,FileReqWidth
  2266.         move.l    d3,FileReqHeight
  2267.         moveq    #0,d0
  2268.         moveq    #0,d1
  2269.         move.w    ra_MaxX(a2),d0
  2270.         addq.w    #1,d0
  2271.         move.w    ra_MaxY(a2),d1
  2272.         addq.w    #1,d1
  2273.         sub.w    d2,d0
  2274.         sub.w    d3,d1
  2275.         lsr.w    #1,d0
  2276.         lsr.w    #1,d1
  2277.         move.l    .Window(a5),a2
  2278.         move.l    wd_WScreen(a2),a2
  2279.         sub.w    sc_LeftEdge(a2),d0
  2280.         sub.w    sc_TopEdge(a2),d1
  2281.         move.l    d0,FileReqLeft
  2282.         move.l    d1,FileReqTop
  2283.  
  2284.         move.l    .Mode(a5),FileReqDirs
  2285.         RELLIB    AllocFileRequest,_AslBase    ; Get structure for filerequester
  2286.         move.l    d0,MyAslRequest(a4)
  2287.         tst.l    d0
  2288.         beq    NoFileName
  2289.  
  2290.         clr.b    DirPath(a4)
  2291.         clr.b    DirFile(a4)
  2292.         move.l    .CompleteName(a5),a0
  2293.         bsr    StrLen
  2294.         lea    0(a0,d0),a0
  2295. .GetFile    cmp.b    #":",(a0)
  2296.         beq.s    .GotFile
  2297.         cmp.b    #"/",(a0)
  2298.         beq.s    .GotFile
  2299.         subq.l    #1,a0
  2300.         dbf    d0,.GetFile
  2301. .GotFile    addq.l    #1,a0
  2302.         lea    DirFile(a4),a1
  2303.         move.l    a0,a2
  2304.         bsr    StrCpy
  2305.         tst.l    d0
  2306.         blt.s    .NoDir
  2307.         move.b    (a2),d6
  2308.         clr.b    (a2)
  2309.         move.l    .CompleteName(a5),a0
  2310.         lea    DirPath(a4),a1
  2311.         bsr    StrCpy
  2312.         move.b    d6,(a2)
  2313. .NoDir        move.l    .Window(a5),FileReqWin        ; Set up filerequester
  2314.         lea    DirPath(a4),a0
  2315.         move.l    a0,FileReqDir
  2316.         lea    DirFile(a4),a0
  2317.         move.l    a0,FileReqFile
  2318.         move.l    .Header(a5),FileReqHeader
  2319.         move.l    MyAslRequest(a4),a0
  2320.         lea    AslFileTags(pc),a1
  2321.         RELLIB    AslRequest,_AslBase        ; Do the request
  2322.         move.l    d0,d7
  2323.         tst.l    d0
  2324.         beq.s    .Canceled
  2325.         move.l    MyAslRequest(a4),a2
  2326.         move.l    rf_Dir(a2),a0
  2327.         move.l    .CompleteName(a5),a1        ; Copy Dir name
  2328.         moveq    #-1,d7
  2329.         bsr    StrCpy
  2330.         move.l    .CompleteName(a5),a0
  2331.         bsr    StrLen
  2332.         tst.b    (a0)
  2333.         beq.s    .GotPath
  2334.         lea    0(a0,d0),a0
  2335.         cmp.b    #"/",-1(a0)
  2336.         beq.s    .GotPath
  2337.         cmp.b    #":",-1(a0)
  2338.         beq.s    .GotPath
  2339.         move.b    #"/",(a0)+
  2340. .GotPath    move.l    a0,a1
  2341.         move.l    rf_File(a2),a0
  2342.         bsr    StrCpy
  2343.         tst.l    .GadgetList(a5)
  2344.         beq.s    .Canceled
  2345.         move.w    .GadgetNum(a5),d0
  2346.         ext.l    d0
  2347.         move.l    .GadgetList(a5),a0
  2348.         move.l    .Window(a5),a1
  2349.         move.l    .CompleteName(a5),a2
  2350.         move.l    .GadFunc(a5),d7
  2351.         move.l    _KCXBase(a4),a6
  2352.         jsr    0(a6,d7)
  2353.         moveq    #1,d7
  2354. .Canceled    move.l    MyAslRequest(a4),a0        ; Copy new position of filereq
  2355.         move.w    rf_LeftEdge(a0),d0
  2356.         move.w    rf_TopEdge(a0),d1
  2357.         ext.l    d0
  2358.         ext.l    d1
  2359.         move.l    d0,FileReqLeft
  2360.         move.l    d1,FileReqTop
  2361.         move.w    rf_Width(a0),d0
  2362.         move.w    rf_Height(a0),d1
  2363.         ext.l    d0
  2364.         ext.l    d1
  2365.         move.l    d0,FileReqWidth
  2366.         move.l    d1,FileReqHeight
  2367.         RELLIB    FreeFileRequest,_AslBase    ; Free request
  2368. NoFileName    unlk    a5
  2369.         move.l    d7,d0
  2370.         movem.l    (sp)+,d1-d7/a0-a6
  2371.         rts
  2372. **********************************************************************
  2373. *                         FileRequester tags                         *
  2374. **********************************************************************
  2375. AslFileTags    dc.l    ASLFR_TitleText
  2376. FileReqHeader    dc.l    0
  2377.         dc.l    ASLFR_Window
  2378. FileReqWin    dc.l    0
  2379.         dc.l    ASLFR_InitialLeftEdge
  2380. FileReqLeft    dc.l    0
  2381.         dc.l    ASLFR_InitialTopEdge
  2382. FileReqTop    dc.l    0
  2383.         dc.l    ASLFR_InitialWidth
  2384. FileReqWidth    dc.l    320
  2385.         dc.l    ASLFR_InitialHeight
  2386. FileReqHeight    dc.l    140
  2387.         dc.l    ASLFR_InitialFile
  2388. FileReqFile    dc.l    0
  2389.         dc.l    ASLFR_InitialDrawer
  2390. FileReqDir    dc.l    0
  2391.         dc.l    ASLFR_Flags1
  2392. FileReqDirs    dc.l    0
  2393.         dc.l    ASLFR_Flags2
  2394.         dc.l    FRF_REJECTICONS
  2395.         dc.l    ASLFR_Locale
  2396. FileReqLoc    dc.l    0
  2397.         dc.l    TAG_DONE
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403. **********************************************************************
  2404. *                        Close the WB-Screen                         *
  2405. **********************************************************************
  2406. OpenPrintScreen    CARGS    #-12,.WBScreen.L,.ModeID.L,.WBDrawInfo.L
  2407.         link    a5,#-(12+dim_SIZEOF)
  2408.         lea    WBName(pc),a0            ; Lock WB-Screen
  2409.         RELLIB    LockPubScreen,_IntuitionBase
  2410.         move.l    d0,.WBScreen(a5)
  2411.         tst.l    d0
  2412.         beq    .NoScreen
  2413.  
  2414.         move.l    .WBScreen(a5),a0        ; Get Screen`s DrawInfo
  2415.         DOLIB    GetScreenDrawInfo
  2416.         move.l    d0,.WBDrawInfo(a5)
  2417.         tst.l    d0
  2418.         beq    .NoScreen
  2419.  
  2420.         move.l    .WBScreen(a5),a0        ; No get ViewPort`s ModeID
  2421.         lea    sc_ViewPort(a0),a0
  2422.         RELLIB    GetVPModeID,_GfxBase
  2423.         move.l    d0,.ModeID(a5)
  2424.         cmp.l    #INVALID_ID,d0
  2425.         beq    .NoScreen
  2426.  
  2427.         move.l    .WBDrawInfo(a5),a0        ; Close the WB`s font
  2428.         move.l    dri_Font(a0),a0
  2429.         move.l    a0,a2
  2430.         move.l    LN_NAME(a0),a0
  2431.         lea    PrintFontName(pc),a1
  2432.         bsr    StrCpy
  2433.  
  2434.         lea    PrintScreenTxt(pc),a0
  2435.         lea    PrintFontName(pc),a1
  2436.         move.l    a1,ta_Name(a0)
  2437.         move.w    tf_YSize(a2),ta_YSize(a0)
  2438.         move.b    tf_Style(a2),ta_Style(a0)
  2439.         move.b    tf_Flags(a2),ta_Flags(a0)
  2440.         DOLIB    OpenFont            ; Try to open font
  2441.         move.l    d0,PrintFont
  2442.         tst.l    d0
  2443.         beq    .NoScreen
  2444.  
  2445.         sub.l    a0,a0                ; Get default sizes of Screen
  2446.         lea    -(12+dim_SIZEOF)(a5),a1
  2447.         move.l    #dim_SIZEOF,d0
  2448.         move.l    #DTAG_DIMS,d1
  2449.         move.l    .ModeID(a5),d2
  2450.         DOLIB    GetDisplayInfoData
  2451.         lea    (-(12+dim_SIZEOF)+dim_Nominal)(a5),a0
  2452.         moveq    #0,d0
  2453.         move.w    ra_MaxX(a0),d0
  2454.         addq.w    #1,d0
  2455.         move.l    d0,ScrWidth+4
  2456.         move.w    ra_MaxY(a0),d0
  2457.         addq.w    #1,d0
  2458.         move.l    d0,ScrHeight+4
  2459.  
  2460.         LOCLEA    WindowScrTitle,a0
  2461.         move.l    a0,ScrName+4
  2462.  
  2463.         moveq    #0,d0                ; Now fill in our taglist
  2464.         move.l    .WBScreen(a5),a2        ; and open the screen
  2465.         sub.l    a0,a0
  2466.         lea    PrintScreenTags(pc),a1
  2467.         moveq    #0,d0
  2468.         move.b    sc_BitMap+bm_Depth(a2),d0
  2469.         move.l    d0,ScrDepth+4
  2470.         move.l    .WBDrawInfo(a5),a3
  2471.         move.l    dri_Pens(a3),ScrPens+4
  2472.         move.l    .ModeID(a5),ScrMode+4
  2473.         RELLIB    OpenScreenTagList,_IntuitionBase
  2474.         move.l    d0,PrintScreen(a4)
  2475.         beq.s    .NoScreen
  2476.  
  2477.         move.l    .WBDrawInfo(a5),a0        ; We don`t need no DrawInfo anymore
  2478.         DOLIB    FreeScreenDrawInfo
  2479.         sub.l    a0,a0
  2480.         move.l    .WBScreen(a5),a1        ; And no lock on the screen
  2481.         DOLIB    UnlockPubScreen
  2482.  
  2483.         move.l    PrintScreen(a4),d0        ; Return pointer to screen
  2484.         unlk    a5
  2485.         rts
  2486. .NoScreen    tst.l    PrintFont            ; Close open resources
  2487.         beq.s    .NoFont
  2488.         move.l    PrintFont(pc),a1
  2489.         RELLIB    CloseFont,_GfxBase
  2490. .NoFont        tst.l    .WBDrawInfo(a5)
  2491.         beq.s    .NoDrawInfo
  2492.         move.l    .WBDrawInfo(a5),a0
  2493.         RELLIB    FreeScreenDrawInfo,_IntuitionBase
  2494. .NoDrawInfo    tst.l    .WBScreen(a5)
  2495.         beq.s    .NoWBScreen
  2496.         sub.l    a0,a0
  2497.         move.l    .WBScreen(a5),a1
  2498.         RELLIB    UnlockPubScreen,_IntuitionBase
  2499. .NoWBScreen    moveq    #0,d0
  2500.         unlk    a5
  2501.         rts
  2502. WBName        dc.b    "Workbench",0
  2503.         EVEN
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515. **********************************************************************
  2516. *                     Get a string froma locale                      *
  2517. **********************************************************************
  2518. GetLocStr    movem.l    d0-d1/a0-a1/a6,-(sp)
  2519.         move.l    MyCatalog,d1
  2520.         beq.s    .End
  2521.         move.l    24(sp),d0
  2522.         beq.s    .End
  2523.         move.l    d0,a1
  2524.         moveq    #0,d0
  2525.         move.l    a1,d1
  2526.         lea    LOCALE_END(pc),a0
  2527.         cmp.l    a0,d1
  2528.         bgt.s    .End
  2529.         lea    LOCALE_START(pc),a0
  2530.         cmp.l    a0,d1
  2531.         blt.s    .End
  2532.         sub.l    a0,d1
  2533.         beq.s    .GetIt
  2534.  
  2535. .Loop        tst.b    (a0)+
  2536.         bne.s    .Ok
  2537.         addq.l    #1,d0
  2538. .Ok        subq.l    #1,d1
  2539.         bne.s    .Loop
  2540.  
  2541. .GetIt        move.l    MyCatalog,a0
  2542.         RELLIB    GetCatalogStr,_LocaleBase
  2543.         move.l    d0,24(sp)
  2544. .End        movem.l    (sp)+,d0-d1/a0-a1/a6
  2545.         rts
  2546.  
  2547.  
  2548. **********************************************************************
  2549. *                    Localize a gadget`s shortcut                    *
  2550. *  A0 = Pointer to text                                              *
  2551. *  RETURN :                                                          *
  2552. *  D1 = Shortcut                                                     *
  2553. **********************************************************************
  2554. LocalizeGadKey    move.l    d0,-(sp)
  2555.         moveq    #0,d1
  2556.         move.l    a0,d2
  2557.         beq.s    .End
  2558. .GetShort    move.b    (a0)+,d2
  2559.         beq.s    .End
  2560.         cmp.b    #'_',d2
  2561.         bne.s    .GetShort
  2562.         moveq    #0,d0
  2563.         move.b    (a0),d0
  2564.         bsr.s    GetUpperCase
  2565.         move.l    d0,d1
  2566. .End        move.l    (sp)+,d0
  2567.         rts
  2568.  
  2569.  
  2570. **********************************************************************
  2571. *          Convert a char to uppercase using Locale or Util          *
  2572. **********************************************************************
  2573. GetUpperCase    movem.l    d1-d7/a0-a6,-(sp)        ; Convert a char to upper case
  2574.         move.l    ZeroBase(pc),a4
  2575.         cmp.l    #48,d0
  2576.         blt.s    .NormChar
  2577.         cmp.l    #57,d0
  2578.         bgt.s    .NormChar
  2579.         lea    ConvTable(pc),a0
  2580.         sub.w    #48,d0
  2581.         moveq    #0,d1
  2582.         move.b    0(a0,d0),d1
  2583.         move.l    d1,d0
  2584. .NormChar    tst.l    MyLocale
  2585.         beq.s    .UseUtil
  2586.         move.l    MyLocale,a0            ; Using Locale
  2587.         RELLIB    ConvToUpper,_LocaleBase
  2588.         bra.s    .End
  2589. .UseUtil    RELLIB    ToUpper,_UtilityBase        ; or utility.library
  2590. .End        movem.l    (sp)+,d1-d7/a0-a6
  2591.         rts
  2592. ConvTable    dc.b    "=","!",'"',"§","$","%","&","/","(",")"
  2593.         EVEN
  2594.  
  2595.  
  2596.  
  2597. **********************************************************************
  2598. *         Localizes tags of a ListView, Cycle and MX gadget          *
  2599. * D0 = Type of Gadget                                                *
  2600. * A2 = Pointer to TagList                                            *
  2601. **********************************************************************
  2602. LocalizeGadTags    movem.l    RegsAll,-(sp)
  2603.         cmp.w    #CYCLE_KIND,d0
  2604.         bne.s    .NoCycle
  2605.         move.l    #GTCY_Labels,d0
  2606.         move.l    a2,a0
  2607.         RELLIB    FindTagItem,_UtilityBase
  2608.         tst.l    d0
  2609.         beq.s    .End
  2610.         move.l    d0,a2
  2611.         move.l    ti_Data(a2),a2
  2612. .PatchCycles    move.l    (a2),d0
  2613.         beq.s    .End
  2614.         move.l    d0,-(sp)
  2615.         bsr    GetLocStr
  2616.         move.l    (sp)+,(a2)
  2617.         addq.l    #4,a2
  2618.         bra.s    .PatchCycles
  2619. .NoCycle
  2620. .End        movem.l    (sp)+,RegsAll
  2621.         rts
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628. **********************************************************************
  2629. *           Include the other`s ByteRunEncoding routine :)           *
  2630. **********************************************************************
  2631.         INCLUDE    PackRow.Asm
  2632.         EVEN
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638. **********************************************************************
  2639. *                 Definitions for Dump screen window                 *
  2640. **********************************************************************
  2641. PrintWinWindowTags:
  2642. PrintWinL:
  2643.     DC.L    WA_Left,0
  2644. PrintWinT:
  2645.     DC.L    WA_Top,0
  2646. PrintWinW:
  2647.     DC.L    WA_Width,0
  2648. PrintWinH:
  2649.     DC.L    WA_Height,0
  2650.     DC.L    WA_IDCMP,CYCLEIDCMP!SLIDERIDCMP!CHECKBOXIDCMP!INTEGERIDCMP!TEXTIDCMP!BUTTONIDCMP!IDCMP_CLOSEWINDOW!IDCMP_VANILLAKEY!IDCMP_CHANGEWINDOW!IDCMP_REFRESHWINDOW
  2651.     DC.L    WA_Flags,WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET!WFLG_SMART_REFRESH!WFLG_ACTIVATE
  2652. PrintWinWG:
  2653.     DC.L    WA_Gadgets,0
  2654.     DC.L    WA_Title,PrintTitle
  2655.     DC.L    WA_ScreenTitle,WindowScrTitle
  2656. PrintWinSC:
  2657.     DC.L    WA_PubScreen,0
  2658.     DC.L    TAG_DONE
  2659.  
  2660.  
  2661.  
  2662. PrintWinGTypes:
  2663.     DC.W    CYCLE_KIND
  2664.     DC.W    CYCLE_KIND
  2665.     DC.W    CYCLE_KIND
  2666.     DC.W    CYCLE_KIND
  2667.     DC.W    SLIDER_KIND
  2668.     DC.W    CHECKBOX_KIND
  2669.     DC.W    CHECKBOX_KIND
  2670.     DC.W    CHECKBOX_KIND
  2671.     DC.W    CYCLE_KIND
  2672.     DC.W    INTEGER_KIND
  2673.     DC.W    INTEGER_KIND
  2674.     DC.W    SLIDER_KIND
  2675.     DC.W    CHECKBOX_KIND
  2676.     DC.W    CHECKBOX_KIND
  2677.     DC.W    CHECKBOX_KIND
  2678.     DC.W    CHECKBOX_KIND
  2679.     DC.W    CYCLE_KIND
  2680.     DC.W    INTEGER_KIND
  2681.     DC.W    INTEGER_KIND
  2682.     DC.W    INTEGER_KIND
  2683.     DC.W    INTEGER_KIND
  2684.     DC.W    CYCLE_KIND
  2685.     DC.W    TEXT_KIND
  2686.     DC.W    BUTTON_KIND
  2687.     DC.W    BUTTON_KIND
  2688.     DC.W    BUTTON_KIND
  2689.     DC.W    BUTTON_KIND
  2690.     DC.W    CYCLE_KIND
  2691.  
  2692.  
  2693.  
  2694. PrintWinNGads:
  2695.     DC.W    123,2,167,12
  2696.     DC.L    GfxAspectText,0
  2697.     DC.W    GD_GfxAspect
  2698.     DC.L    PLACETEXT_LEFT,0,0
  2699.     DC.W    123,18,167,12
  2700.     DC.L    GfxShadeText,0
  2701.     DC.W    GD_GfxShade
  2702.     DC.L    PLACETEXT_LEFT,0,0
  2703.     DC.W    123,34,167,12
  2704.     DC.L    GfxDitherText,0
  2705.     DC.W    GD_GfxDither
  2706.     DC.L    PLACETEXT_LEFT,0,0
  2707.     DC.W    367,2,167,12
  2708.     DC.L    GfxImageText,0
  2709.     DC.W    GD_GfxImage
  2710.     DC.L    PLACETEXT_LEFT,0,0
  2711.     DC.W    182,66,108,11
  2712.     DC.L    GfxDensityText,0
  2713.     DC.W    GD_GfxDensity
  2714.     DC.L    PLACETEXT_LEFT,0,0
  2715.     DC.W    299,18,26,11
  2716.     DC.L    GfxRedText,0
  2717.     DC.W    GD_GfxRed
  2718.     DC.L    PLACETEXT_RIGHT,0,0
  2719.     DC.W    372,18,26,11
  2720.     DC.L    GfxGreenText,0
  2721.     DC.W    GD_GfxGreen
  2722.     DC.L    PLACETEXT_RIGHT,0,0
  2723.     DC.W    456,18,26,11
  2724.     DC.L    GfxBlueText,0
  2725.     DC.W    GD_GfxBlue
  2726.     DC.L    PLACETEXT_RIGHT,0,0
  2727.     DC.W    123,50,167,12
  2728.     DC.L    GfxScaleText,0
  2729.     DC.W    GD_GfxScale
  2730.     DC.L    PLACETEXT_LEFT,0,0
  2731.     DC.W    371,50,70,12
  2732.     DC.L    GfxSize1Text,0
  2733.     DC.W    GD_GfxSize1
  2734.     DC.L    PLACETEXT_LEFT,0,0
  2735.     DC.W    465,50,70,12
  2736.     DC.L    GfxSize2Text,0
  2737.     DC.W    GD_GfxSize2
  2738.     DC.L    PLACETEXT_LEFT,0,0
  2739.     DC.W    182,81,108,11
  2740.     DC.L    GfxThresText,0
  2741.     DC.W    GD_GfxThres
  2742.     DC.L    PLACETEXT_LEFT,0,0
  2743.     DC.W    299,66,26,11
  2744.     DC.L    GfxCenterText,0
  2745.     DC.W    GD_GfxCenter
  2746.     DC.L    PLACETEXT_RIGHT,0,0
  2747.     DC.W    433,66,26,11
  2748.     DC.L    GfxSmoothText,0
  2749.     DC.W    GD_GfxSmooth
  2750.     DC.L    PLACETEXT_RIGHT,0,0
  2751.     DC.W    299,81,26,11
  2752.     DC.L    GfxFormFeedText,0
  2753.     DC.W    GD_GfxFormFeed
  2754.     DC.L    PLACETEXT_RIGHT,0,0
  2755.     DC.W    433,81,26,11
  2756.     DC.L    GfxKeepAspectText,0
  2757.     DC.W    GD_GfxKeepAspect
  2758.     DC.L    PLACETEXT_RIGHT,0,0
  2759.     DC.W    117,114,120,12
  2760.     DC.L    GfxGfxTypeText,0
  2761.     DC.W    GD_GfxGfxType
  2762.     DC.L    PLACETEXT_LEFT,0,0
  2763.     DC.W    257,114,52,13
  2764.     DC.L    GfxXText,0
  2765.     DC.W    GD_GfxX
  2766.     DC.L    PLACETEXT_LEFT,0,0
  2767.     DC.W    337,114,52,13
  2768.     DC.L    GfxYText,0
  2769.     DC.W    GD_GfxY
  2770.     DC.L    PLACETEXT_LEFT,0,0
  2771.     DC.W    417,114,52,13
  2772.     DC.L    GfxWidthText,0
  2773.     DC.W    GD_GfxWidth
  2774.     DC.L    PLACETEXT_LEFT,0,0
  2775.     DC.W    497,114,52,13
  2776.     DC.L    GfxHeightText,0
  2777.     DC.W    GD_GfxHeight
  2778.     DC.L    PLACETEXT_LEFT,0,0
  2779.     DC.W    117,130,120,12
  2780.     DC.L    GfxSourceText,0
  2781.     DC.W    GD_GfxSource
  2782.     DC.L    PLACETEXT_LEFT,0,0
  2783.     DC.W    238,130,310,12
  2784.     DC.L    0,0
  2785.     DC.W    GD_GfxSourceName
  2786.     DC.L    0,0,0
  2787.     DC.W    124,148,166,12
  2788.     DC.L    GfxGetText,0
  2789.     DC.W    GD_GfxGet
  2790.     DC.L    PLACETEXT_IN,0,0
  2791.     DC.W    34,148,86,12
  2792.     DC.L    GfxPrintText,0
  2793.     DC.W    GD_GfxPrint
  2794.     DC.L    PLACETEXT_IN,0,0
  2795.     DC.W    464,148,86,12
  2796.     DC.L    GfxCancelText,0
  2797.     DC.W    GD_GfxCancel
  2798.     DC.L    PLACETEXT_IN,0,0
  2799.     DC.W    294,148,166,12
  2800.     DC.L    GfxBoundsText,0
  2801.     DC.W    GD_GfxBounds
  2802.     DC.L    PLACETEXT_IN,0,0
  2803.     DC.W    257,100,120,12
  2804.     DC.L    GfxDumpTypeText,0
  2805.     DC.W    GD_GfxDumpType
  2806.     DC.L    PLACETEXT_LEFT,0,0
  2807.  
  2808. PrintWinGTags:
  2809.     DC.L    GTCY_Labels,GfxAspectLabels
  2810.     DC.L    GT_Underscore,'_'
  2811.     DC.L    TAG_DONE
  2812.     DC.L    GTCY_Labels,GfxShadeLabels
  2813.     DC.L    GT_Underscore,'_'
  2814.     DC.L    TAG_DONE
  2815.     DC.L    GTCY_Labels,GfxDitherLabels
  2816.     DC.L    GT_Underscore,'_'
  2817.     DC.L    TAG_DONE
  2818.     DC.L    GTCY_Labels,GfxImageLabels
  2819.     DC.L    GT_Underscore,'_'
  2820.     DC.L    TAG_DONE
  2821.     DC.L    GTSL_Min,1
  2822.     DC.L    GTSL_Max,7
  2823.     DC.L    GTSL_MaxLevelLen,6
  2824.     DC.L    GTSL_LevelFormat,ScrDimmFormat
  2825.     DC.L    PGA_Freedom,LORIENT_HORIZ
  2826.     DC.L    GA_RelVerify,1
  2827.     DC.L    GT_Underscore,'_'
  2828.     DC.L    TAG_DONE
  2829.     DC.L    GTCB_Scaled,-1
  2830.     DC.L    GT_Underscore,'_'
  2831.     DC.L    TAG_DONE
  2832.     DC.L    GTCB_Scaled,-1
  2833.     DC.L    GT_Underscore,'_'
  2834.     DC.L    TAG_DONE
  2835.     DC.L    GTCB_Scaled,-1
  2836.     DC.L    GT_Underscore,'_'
  2837.     DC.L    TAG_DONE
  2838.     DC.L    GTCY_Labels,GfxScaleLabels
  2839.     DC.L    GT_Underscore,'_'
  2840.     DC.L    TAG_DONE
  2841.     DC.L    GTST_EditHook,StrEditHook
  2842.     DC.L    STRINGA_ExitHelp,1
  2843.     DC.L    GTIN_Number,0
  2844.     DC.L    GTIN_MaxChars,6
  2845.     DC.L    GT_Underscore,'_'
  2846.     DC.L    TAG_DONE
  2847.     DC.L    GTST_EditHook,StrEditHook
  2848.     DC.L    STRINGA_ExitHelp,1
  2849.     DC.L    GTIN_Number,0
  2850.     DC.L    GTIN_MaxChars,6
  2851.     DC.L    GT_Underscore,'_'
  2852.     DC.L    TAG_DONE
  2853.     DC.L    GTSL_Min,1
  2854.     DC.L    GTSL_MaxLevelLen,6
  2855.     DC.L    GTSL_LevelFormat,ScrDimmFormat
  2856.     DC.L    PGA_Freedom,LORIENT_HORIZ
  2857.     DC.L    GA_RelVerify,1
  2858.     DC.L    GT_Underscore,'_'
  2859.     DC.L    TAG_DONE
  2860.     DC.L    GTCB_Scaled,-1
  2861.     DC.L    GT_Underscore,'_'
  2862.     DC.L    TAG_DONE
  2863.     DC.L    GTCB_Scaled,-1
  2864.     DC.L    GT_Underscore,'_'
  2865.     DC.L    TAG_DONE
  2866.     DC.L    GTCB_Scaled,-1
  2867.     DC.L    GT_Underscore,'_'
  2868.     DC.L    TAG_DONE
  2869.     DC.L    GTCB_Scaled,-1
  2870.     DC.L    GT_Underscore,'_'
  2871.     DC.L    TAG_DONE
  2872.     DC.L    GTCY_Labels,GfxGfxTypeLabels
  2873.     DC.L    GT_Underscore,'_'
  2874.     DC.L    TAG_DONE
  2875.     DC.L    GTST_EditHook,StrEditHook
  2876.     DC.L    STRINGA_ExitHelp,1
  2877.     DC.L    GTIN_Number,0
  2878.     DC.L    GTIN_MaxChars,4
  2879.     DC.L    GT_Underscore,'_'
  2880.     DC.L    TAG_DONE
  2881.     DC.L    GTST_EditHook,StrEditHook
  2882.     DC.L    STRINGA_ExitHelp,1
  2883.     DC.L    GTIN_Number,0
  2884.     DC.L    GTIN_MaxChars,4
  2885.     DC.L    GT_Underscore,'_'
  2886.     DC.L    TAG_DONE
  2887.     DC.L    GTST_EditHook,StrEditHook
  2888.     DC.L    STRINGA_ExitHelp,1
  2889.     DC.L    GTIN_Number,0
  2890.     DC.L    GTIN_MaxChars,4
  2891.     DC.L    GT_Underscore,'_'
  2892.     DC.L    TAG_DONE
  2893.     DC.L    GTST_EditHook,StrEditHook
  2894.     DC.L    STRINGA_ExitHelp,1
  2895.     DC.L    GTIN_Number,0
  2896.     DC.L    GTIN_MaxChars,4
  2897.     DC.L    GT_Underscore,'_'
  2898.     DC.L    TAG_DONE
  2899.     DC.L    GTCY_Labels,GfxSourceLabels
  2900.     DC.L    GT_Underscore,'_'
  2901.     DC.L    TAG_DONE
  2902.     DC.L    GTTX_Border,1
  2903.     DC.L    TAG_DONE
  2904.     DC.L    GT_Underscore,'_'
  2905.     DC.L    TAG_DONE
  2906.     DC.L    GT_Underscore,'_'
  2907.     DC.L    TAG_DONE
  2908.     DC.L    GT_Underscore,'_'
  2909.     DC.L    TAG_DONE
  2910.     DC.L    GT_Underscore,'_'
  2911.     DC.L    TAG_DONE
  2912.     DC.L    GTCY_Labels,GfxDumpTypeLabels
  2913.     DC.L    GT_Underscore,'_'
  2914.     DC.L    TAG_DONE
  2915.  
  2916.  
  2917.  
  2918. GfxAspectLabels:
  2919.     DC.L    GfxAspectLab0
  2920.     DC.L    GfxAspectLab1
  2921.     DC.L    0
  2922. GfxShadeLabels:
  2923.     DC.L    GfxShadeLab0
  2924.     DC.L    GfxShadeLab1
  2925.     DC.L    GfxShadeLab2
  2926.     DC.L    GfxShadeLab3
  2927.     DC.L    0
  2928. GfxDitherLabels:
  2929.     DC.L    GfxDitherLab0
  2930.     DC.L    GfxDitherLab1
  2931.     DC.L    GfxDitherLab2
  2932.     DC.L    0
  2933. GfxImageLabels:
  2934.     DC.L    GfxImageLab0
  2935.     DC.L    GfxImageLab1
  2936.     DC.L    0
  2937. GfxScaleLabels:
  2938.     DC.L    GfxScaleLab0
  2939.     DC.L    GfxScaleLab1
  2940.     DC.L    GfxScaleLab2
  2941.     DC.L    GfxScaleLab3
  2942.     DC.L    GfxScaleLab4
  2943.     DC.L    0
  2944. GfxGfxTypeLabels:
  2945.     DC.L    GfxGfxTypeLab0
  2946.     DC.L    GfxGfxTypeLab1
  2947.     DC.L    0
  2948. GfxSourceLabels:
  2949.     DC.L    GfxSourceLab0
  2950.     DC.L    GfxSourceLab1
  2951.     DC.L    0
  2952. GfxDumpTypeLabels:
  2953.     DC.L    GfxDumpTypeLab0
  2954.     DC.L    GfxDumpTypeLab1
  2955.     DC.L    0
  2956.  
  2957. GD_GfxAspect                           EQU    0
  2958. GD_GfxShade                            EQU    1
  2959. GD_GfxDither                           EQU    2
  2960. GD_GfxImage                            EQU    3
  2961. GD_GfxDensity                          EQU    4
  2962. GD_GfxRed                              EQU    5
  2963. GD_GfxGreen                            EQU    6
  2964. GD_GfxBlue                             EQU    7
  2965. GD_GfxScale                            EQU    8
  2966. GD_GfxSize1                            EQU    9
  2967. GD_GfxSize2                            EQU    10
  2968. GD_GfxThres                            EQU    11
  2969. GD_GfxCenter                           EQU    12
  2970. GD_GfxSmooth                           EQU    13
  2971. GD_GfxFormFeed                         EQU    14
  2972. GD_GfxKeepAspect                       EQU    15
  2973. GD_GfxGfxType                          EQU    16
  2974. GD_GfxX                                EQU    17
  2975. GD_GfxY                                EQU    18
  2976. GD_GfxWidth                            EQU    19
  2977. GD_GfxHeight                           EQU    20
  2978. GD_GfxSource                           EQU    21
  2979. GD_GfxSourceName                       EQU    22
  2980. GD_GfxGet                              EQU    23
  2981. GD_GfxPrint                            EQU    24
  2982. GD_GfxCancel                           EQU    25
  2983. GD_GfxBounds                           EQU    26
  2984. GD_GfxDumpType                         EQU    27
  2985.  
  2986.  
  2987. ShadeFlags    dc.w    SHADE_BW,SHADE_GREYSCALE,SHADE_GREYSCALE,SHADE_COLOR
  2988. DitherFlags    dc.w    ORDERED_DITHERING,HALFTONE_DITHERING,FLOYD_DITHERING
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994. **********************************************************************
  2995. *                    Tags for opening the screen                     *
  2996. **********************************************************************
  2997. PrintScreenTags
  2998. ScrWidth    dc.l    SA_Width,0
  2999. ScrHeight    dc.l    SA_Height,0
  3000. ScrDepth    dc.l    SA_Depth,2
  3001.         dc.l    SA_Overscan,OSCAN_TEXT
  3002.         dc.l    SA_AutoScroll,1
  3003. ScrPens        dc.l    SA_Pens,0
  3004. ScrFont        dc.l    SA_Font,PrintScreenTxt
  3005. ScrMode        dc.l    SA_DisplayID,0
  3006. ScrName        dc.l    SA_Title,0
  3007.         dc.l    TAG_DONE
  3008. PrintScreenTxt    ds.b    ta_SIZEOF
  3009. PrintFontName    ds.b    80
  3010. PrintFont    dc.l    0
  3011.  
  3012.  
  3013. **********************************************************************
  3014. *         List of gadgets to be disabled before dump to file         *
  3015. **********************************************************************
  3016. DisableList    dc.l    GD_GfxAspect
  3017.         dc.l    GD_GfxShade
  3018.         dc.l    GD_GfxDither
  3019.         dc.l    GD_GfxImage
  3020.         dc.l    GD_GfxDensity
  3021.         dc.l    GD_GfxRed
  3022.         dc.l    GD_GfxGreen
  3023.         dc.l    GD_GfxBlue
  3024.         dc.l    GD_GfxScale
  3025.         dc.l    GD_GfxSize1
  3026.         dc.l    GD_GfxSize2
  3027.         dc.l    GD_GfxThres
  3028.         dc.l    GD_GfxCenter
  3029.         dc.l    GD_GfxSmooth
  3030.         dc.l    GD_GfxFormFeed
  3031.         dc.l    GD_GfxKeepAspect
  3032.         dc.l    GD_GfxGfxType
  3033.         dc.l    GD_GfxX
  3034.         dc.l    GD_GfxY
  3035.         dc.l    GD_GfxWidth
  3036.         dc.l    GD_GfxHeight
  3037.         dc.l    GD_GfxSource
  3038.         dc.l    GD_GfxSourceName
  3039.         dc.l    GD_GfxGet
  3040.         dc.l    GD_GfxPrint
  3041.         dc.l    GD_GfxBounds
  3042.         dc.l    GD_GfxDumpType
  3043.         dc.l    -1
  3044.  
  3045. **********************************************************************
  3046. *                             Edit-Hook                              *
  3047. **********************************************************************
  3048. StrEditHook    ds.b    h_SIZEOF
  3049.  
  3050.  
  3051.  
  3052. **********************************************************************
  3053. *                      Buffers for File-Dumping                      *
  3054. **********************************************************************
  3055. CMAPVal        dc.l    0
  3056. PackedRow    dc.l    0
  3057. FromPtr        dc.l    0
  3058. PrintFileCols    ds.b    4
  3059. PrintFileName    ds.b    256
  3060. PrintDumpHeader    dc.b    "Select file to dump to",0
  3061.         EVEN
  3062.  
  3063.  
  3064.  
  3065. **********************************************************************
  3066. *                            Some titles                             *
  3067. **********************************************************************
  3068. ScrDimmFormat    dc.b    "%2.2ld",0
  3069.         EVEN
  3070.  
  3071.  
  3072.  
  3073.  
  3074. **********************************************************************
  3075. *                  Definitions for ILBM-Structures                   *
  3076. **********************************************************************
  3077.     STRUCTURE BitMapHeader,0
  3078.         UWORD     bmh_Width
  3079.         UWORD     bmh_Height
  3080.         WORD     bmh_Left
  3081.         WORD     bmh_Top
  3082.         UBYTE     bmh_Depth
  3083.         UBYTE     bmh_Masking
  3084.         UBYTE     bmh_Compression
  3085.         UBYTE     bmh_Pad
  3086.         UWORD     bmh_Transparent
  3087.         UBYTE     bmh_XAspect
  3088.         UBYTE     bmh_YAspect
  3089.         WORD     bmh_PageWidth
  3090.         WORD     bmh_PageHeight
  3091.     LABEL BitMapHeader_SIZEOF
  3092. BMHDChunk    ds.b    BitMapHeader_SIZEOF
  3093.  
  3094.  
  3095.  
  3096. **********************************************************************
  3097. *                         AutoRequester-Texts                        *
  3098. **********************************************************************
  3099. Only20ITxt    dc.b    0,1
  3100.         dc.b    RP_JAM1
  3101.         dc.b    0
  3102.         dc.w    10,10
  3103.         dc.l    0
  3104.         dc.l    Only20Txt
  3105.         dc.l    0
  3106. Only20Txt    dc.b    "KCommodity V"
  3107.         REVISION
  3108.         dc.b    " still only runs under OS 2.x !",$0a,0
  3109. Only20TxtEnd
  3110.         EVEN
  3111. OkITxt        dc.b    2,1
  3112.         dc.b    RP_JAM1
  3113.         dc.b    0
  3114.         dc.w    6,3
  3115.         dc.l    0
  3116.         dc.l    OkTxt
  3117.         dc.l    0
  3118. OkTxt        dc.b    "OK",0
  3119.         EVEN
  3120.  
  3121.  
  3122.  
  3123. **********************************************************************
  3124. *                            Revision Tag                            *
  3125. **********************************************************************
  3126. VersionTag    dc.l    RevStr
  3127. RevStr        REVISION
  3128.         dc.b    0
  3129.         EVEN
  3130.  
  3131.  
  3132.  
  3133.  
  3134. LOCALE_START
  3135. * CATALOG kcxdump
  3136. * VERSION 2.5
  3137. * DATE 01.02.93
  3138. DefPrintTitle        dc.b    "Graphics dump : HotKey=",0
  3139. * D                "Graphikausdruck : HotKey=",0
  3140. WindowScrTitle        dc.b    "KCommodity by Kai Iske. ShareWare",0
  3141. * D                "KCommodity von Kai Iske. ShareWare",0
  3142. GfxGetTitle        dc.b    "Position mouse and press left button",0
  3143. * D                "Positionieren Sie die Maus und drücken Sie die linke Maustaste.",0
  3144. GfxDumpingTitle        dc.b    "Dump in progress !!!",0
  3145. * D                "Druck in Arbeit !!!",0
  3146. PrintHead        dc.b    "KCX-GraphicsDump",0
  3147. * D                "KCX-GraphikDruck",0
  3148. NoBackText        dc.b    "KCommodity V%s is not running. Aborting.",10,0
  3149. * D                "KCommodity V%s ist nicht aktiv. Abbruch.",10,0
  3150. GfxAspectText        dc.b    "_Aspect",0
  3151. * D                "Ausrich_tung",0
  3152. GfxShadeText        dc.b    "_Shade",0
  3153. * D                "_Schattierung",0
  3154. GfxDitherText        dc.b    "_Dithering",0
  3155. * D                "Schatt_en",0
  3156. GfxImageText        dc.b    "_Image",0
  3157. * D                "B_ild",0
  3158. GfxDensityText        dc.b    "D_ensity      ",0
  3159. * D                "_Dichte      ",0
  3160. GfxRedText        dc.b    "_Red",0
  3161. * D                "_Rot",0
  3162. GfxGreenText        dc.b    "_Green",0
  3163. * D                "_Grün",0
  3164. GfxBlueText        dc.b    "_Blue",0
  3165. * D                "B_lau",0
  3166. GfxScaleText        dc.b    "Sca_ling",0
  3167. * D                "S_kalierung",0
  3168. GfxSize1Text        dc.b    "Si_ze",0
  3169. * D                "Grö_ße",0
  3170. GfxSize2Text        dc.b    "x",0
  3171. * D                "x",0
  3172. GfxThresText        dc.b    "_Threshold      ",0
  3173. * D                "SW-Gren_ze      ",0
  3174. GfxCenterText        dc.b    "Ce_ntered",0
  3175. * D                "Ze_ntriert",0
  3176. GfxSmoothText        dc.b    "S_moothing",0
  3177. * D                "_Weich",0
  3178. GfxFormFeedText        dc.b    "_FormFeed",0
  3179. * D                "_FormFeed",0
  3180. GfxKeepAspectText    dc.b    "_Keep aspect",0
  3181. * D                "Pr_oportionen",0
  3182. GfxGfxTypeText        dc.b    "Gra_phic",0
  3183. * D                "Gra_phik",0
  3184. GfxXText        dc.b    "_X",0
  3185. * D                "_X",0
  3186. GfxYText        dc.b    "_Y",0
  3187. * D                "_Y",0
  3188. GfxWidthText        dc.b    "_W",0
  3189. * D                "_B",0
  3190. GfxHeightText        dc.b    "_H",0
  3191. * D                "_H",0
  3192. GfxSourceText        dc.b    "S_ource",0
  3193. * D                "Quelle",0
  3194. GfxGetText        dc.b    "Reselect source (_1)",0
  3195. * D                "Neue Quelle (_1)",0
  3196. GfxPrintText        dc.b    "D_ump",0
  3197. * D                "Dr_ucken",0
  3198. GfxCancelText        dc.b    "_Cancel",0
  3199. * D                "_Abbruch",0
  3200. GfxBoundsText        dc.b    "Define area (_2)",0
  3201. * D                "Ausschnitt (_2)",0
  3202. GfxDumpTypeText        dc.b    "Dump type (_3)",0
  3203. * D                "Druck Typ (_3)",0
  3204. GfxAspectLab0        dc.b    "Horizontal",0
  3205. * D                "Horizontal",0
  3206. GfxAspectLab1        dc.b    "Vertical",0
  3207. * D                "Vertikal",0
  3208. GfxShadeLab0        dc.b    "Black & White",0
  3209. * D                "Schwarz & Weiß",0
  3210. GfxShadeLab1        dc.b    "Grey Scale 1",0
  3211. * D                "Graustufen 1",0
  3212. GfxShadeLab2        dc.b    "Grey Scale 2",0
  3213. * D                "Graustufen 2",0
  3214. GfxShadeLab3        dc.b    "Color",0
  3215. * D                "Farbe",0
  3216. GfxDitherLab0        dc.b    "Ordered",0
  3217. * D                "Geordnet",0
  3218. GfxDitherLab1        dc.b    "Halftone",0
  3219. * D                "Halbtöne",0
  3220. GfxDitherLab2        dc.b    "Floyd-Steinberg",0
  3221. * D                "Floyd-Steinberg",0
  3222. GfxImageLab0        dc.b    "Positive",0
  3223. * D                "Positiv ",0
  3224. GfxImageLab1        dc.b    "Negative",0
  3225. * D                "Negativ ",0
  3226. GfxScaleLab0        dc.b    "inch x inch",0
  3227. * D                "Zoll x Zoll",0
  3228. GfxScaleLab1        dc.b    "mm x mm",0
  3229. * D                "mm x mm",0
  3230. GfxScaleLab2        dc.b    "cm x cm",0
  3231. * D                "cm x cm",0
  3232. GfxScaleLab3        dc.b    "Fraction",0
  3233. * D                "Prozentual",0
  3234. GfxScaleLab4        dc.b    "Full page",0
  3235. * D                "Ganze Seite",0
  3236. GfxGfxTypeLab0        dc.b    "Complete",0
  3237. * D                "Komplett",0
  3238. GfxGfxTypeLab1        dc.b    "Area",0
  3239. * D                "Ausschnitt",0
  3240. GfxSourceLab0        dc.b    "Screen",0
  3241. * D                "Screen",0
  3242. GfxSourceLab1        dc.b    "Window",0
  3243. * D                "Fenster",0
  3244. GfxDumpTypeLab0        dc.b    "Printer",0
  3245. * D                "Drucker",0
  3246. GfxDumpTypeLab1        dc.b    "File",0
  3247. * D                "Datei",0
  3248. LOCALE_END
  3249.  
  3250.  
  3251.         INCLUDE    KCX.BSS
  3252.         END
  3253.